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
No related branches found
No related tags found
1 merge request!93Resolve "Only show apps which are installed when configuring roles"
Pipeline #37602 passed with stages
in 2 minutes and 51 seconds
......@@ -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.
Finish editing this message first!
Please register or to comment