Skip to content

Commit

Permalink
fix: operator redirect if user is manager
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Oct 2, 2023
1 parent a81640a commit 6a0c4b3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions uniticket/uni_ticket/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,10 @@ def new_func(*original_args, **original_kwargs):
structure = get_object_or_404(
OrganizationalStructure, slug=structure_slug, is_active=True
)

if user_is_manager(request.user, structure):
return custom_message(
request,
_("Accesso da operatore non consentito." " Sei un manager."),
structure_slug=structure_slug,
)
return redirect("uni_ticket:manager_dashboard", structure_slug=structure_slug)

oe = user_is_operator(request.user, structure)
if oe:
original_kwargs["office_employee"] = oe
Expand Down

0 comments on commit 6a0c4b3

Please sign in to comment.