Ensure user has owner role on workspace
This commit is contained in:
parent
e087c51045
commit
474e915402
@ -23,7 +23,10 @@ def home():
|
|||||||
if num_workspaces == 0:
|
if num_workspaces == 0:
|
||||||
return redirect(url_for("requests.requests_index"))
|
return redirect(url_for("requests.requests_index"))
|
||||||
elif num_workspaces == 1:
|
elif num_workspaces == 1:
|
||||||
workspace_id = g.current_user.workspace_roles[0].workspace_id
|
workspace_role = g.current_user.workspace_roles[0]
|
||||||
|
workspace_id = workspace_role.workspace.id
|
||||||
|
is_request_owner = workspace_role.role.name == "owner"
|
||||||
|
|
||||||
if is_request_owner:
|
if is_request_owner:
|
||||||
return redirect(
|
return redirect(
|
||||||
url_for("workspaces.workspace_reports", workspace_id=workspace_id)
|
url_for("workspaces.workspace_reports", workspace_id=workspace_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user