diff --git a/backend/areas/users/user_service.py b/backend/areas/users/user_service.py index 0e982eb713964994b7cfd2372e4c70329c167b80..99169f5656437150e21bc611c0a08812288feb36 100644 --- a/backend/areas/users/user_service.py +++ b/backend/areas/users/user_service.py @@ -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