Skip to content

Commit

Permalink
change position of decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiHaDev committed Apr 5, 2024
1 parent c15233f commit cb2f5eb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions controllers/v2/unavailability/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ def __init__(self, event_repository: EventRepository = EventRepository()):
self.event_repository = event_repository

@requires_auth
@is_user_or_has_role(None, UserType.ROOT_ADMIN)
def put(self, user_id, event_id):
@is_user_or_has_role(user_id, UserType.ROOT_ADMIN)
def edit_unavailability():
try:
with session_scope() as session:
args = edit_parser.parse_args()
return self.event_repository.edit_event(session, user_id, event_id, **args)
try:
edit_unavailability()
self.event_repository.edit_event(session, user_id, event_id, **args)
return {"message": "Updated successfully"}, 200
except InvalidArgumentError as argumentException:
logging.warning(argumentException)
Expand Down

0 comments on commit cb2f5eb

Please sign in to comment.