Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sondregronas committed Aug 6, 2023
1 parent 8d56fc0 commit 06d8765
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions BookingSystem/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ def wrapper(*args, **kwargs) -> callable:
flask.abort(403)
return func(*args, **kwargs)

# Add attributes to the wrapper function so we can check if the decorator is used on a function. (tests)
wrapper.login_required = True
wrapper.admin_required = admin_only
wrapper.api_allowed = api

return wrapper

return decorator
Expand Down

0 comments on commit 06d8765

Please sign in to comment.