Skip to content
Snippets Groups Projects
Commit 09f1d2e0 authored by Luka's avatar Luka Committed by Maarten de Waard
Browse files

Optimize insert app role to user

parent bc85575e
No related branches found
No related tags found
1 merge request!55Resolve "Merge dashboard and dashboard-backend repos"
......@@ -81,13 +81,12 @@ class UserService:
@staticmethod
def __insertAppRoleToUser(userId, userRes):
app_role = AppRole.query.filter_by(user_id=userId)
apps = App.query.all()
app_roles = []
for app in apps:
tmp_app_role = app_role.filter_by(app_id=app.id).first()
tmp_app_role = AppRole.query.filter_by(
user_id=userId, app_id=app.id
).first()
app_roles.append(
{
"name": app.slug,
......
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