Skip to content
Snippets Groups Projects
Commit 61deaf61 authored by Mart van Santen's avatar Mart van Santen
Browse files

Add condition to check if app is installed to show options

parent 248fd636
Branches
No related tags found
No related merge requests found
......@@ -183,15 +183,19 @@ class UserService:
apps = App.query.all()
app_roles = []
for app in apps:
tmp_app_role = AppRole.query.filter_by(
user_id=userId, app_id=app.id
).first()
app_roles.append(
{
"name": app.slug,
"role_id": tmp_app_role.role_id if tmp_app_role else None,
}
)
# Only show role when installed
app_status = app.get_status()
if app_status.installed:
tmp_app_role = AppRole.query.filter_by(
user_id=userId, app_id=app.id
).first()
app_roles.append(
{
"name": app.slug,
"role_id": tmp_app_role.role_id if tmp_app_role else None,
}
)
userRes["traits"]["app_roles"] = app_roles
return userRes
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment