Skip to content

Commit

Permalink
new fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zimovchik committed Jul 11, 2024
1 parent 3c7d24a commit 6e9c0fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions services_backend/routes/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,13 @@ def get_buttons(
"name": button.name,
"order": button.order,
"type": button.type,
"link": button.link if user_scopes.issuperset(button.required_scopes) else None,
"view": view.value,
"required_scopes": button.required_scopes,
"optional_scopes": button.optional_scopes,
}
if view == ButtonView.ACTIVE:
to_add["scopes"] = list(scopes)
if user_scopes.issuperset(button.required_scopes):
to_add["link"] = button.link
result["buttons"].append(to_add)

return result
Expand Down Expand Up @@ -181,14 +180,14 @@ def get_button(
"name": button.name,
"order": button.order,
"type": button.type,
"link": button.link if user_scopes.issuperset(button.required_scopes) else None,
"view": view.value,
"required_scopes": button.required_scopes,
"required_scopes": button.
required_scopes,
"optional_scopes": button.optional_scopes,
}
if view == ButtonView.ACTIVE:
result["scopes"] = list(scopes)
if user_scopes.issuperset(button.required_scopes):
result["link"] = button.link
return result


Expand Down Expand Up @@ -308,7 +307,7 @@ def get_service(
"id": button.id,
"icon": button.icon,
"name": button.name,
"link": button.link,
"link": button.link if user_scopes.issuperset(button.required_scopes) else None,
"order": button.order,
"type": button.type,
"view": view.value,
Expand Down
2 changes: 1 addition & 1 deletion services_backend/routes/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def get_categories(
"id": button.id,
"icon": button.icon,
"name": button.name,
"link": button.link,
"link": button.link if user_scopes.issuperset(button.required_scopes) else None,
"order": button.order,
"type": button.type,
"view": view.value,
Expand Down

0 comments on commit 6e9c0fc

Please sign in to comment.