From 59f85877b8a97cfb6950d524cdb23d6d94d2b3f6 Mon Sep 17 00:00:00 2001 From: "Steven (Quoc)" Date: Mon, 18 Mar 2024 13:23:51 +1100 Subject: [PATCH] passed high priorty test cases refining base functionality --- controllers/v2/unavailability/api.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/controllers/v2/unavailability/api.py b/controllers/v2/unavailability/api.py index 06cb4ffa..e33f95e3 100644 --- a/controllers/v2/unavailability/api.py +++ b/controllers/v2/unavailability/api.py @@ -51,9 +51,9 @@ class VolunteerUnavailabilityV2(Resource): def __init__(self): self.event_repository = EventRepository() - # @requires_auth + @requires_auth @marshal_with(volunteer_unavailability_time) - # @is_user_or_has_role(None, UserType.ROOT_ADMIN) + @is_user_or_has_role(None, UserType.ROOT_ADMIN) def get(self, user_id): volunteer_unavailability_record = self.event_repository.get_event(user_id) if volunteer_unavailability_record is not None: @@ -61,8 +61,8 @@ def get(self, user_id): else: return {"message": "No unavailability record found."}, 400 - # @requires_auth - # @is_user_or_has_role(None, UserType.ROOT_ADMIN) + @requires_auth + @is_user_or_has_role(None, UserType.ROOT_ADMIN) def post(self, user_id): try: args = edit_parser.parse_args() @@ -76,7 +76,6 @@ def post(self, user_id): return {"message": "Time frames overlap with existing events", "overlapping events": overlapping_events}, 400 - eventId = self.event_repository.create_event( user_id, args['title'],