Skip to content

Commit

Permalink
Development admin accessibility (#369)
Browse files Browse the repository at this point in the history
* Adding access to admin to request vacations for other users

* Adding admin endpoit

* fixing vacation card error

* Development admin accessibility backend (#368)

* Implementation: Implemented an endpoint for admins to post vacations behalf of the user.

* Enhancement: rename the route of the admin vacations request

* Typo: replaced the pinding by pending.

* Using enum in selectionOption and exporting ListUsers in helpers

* Update: update the request status of the user request.

---------

Co-authored-by: mayar osama <[email protected]>
  • Loading branch information
Mahmoud-Emad and maayarosama authored Mar 6, 2024
1 parent e1ec9aa commit 1705d1b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/cshr/views/vacations.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,9 +861,6 @@ def post(self, request: Request, user_id: str) -> Response:
except:
return http_ensure_redis_error()

# set_notification_request_redis(serializer.data)
response_data: Dict = send_vacation_to_calendar(saved_vacation)

# Update the balance
balance = v.check_and_update_balance(
applying_user=saved_vacation.applying_user,
Expand All @@ -881,5 +878,7 @@ def post(self, request: Request, user_id: str) -> Response:
saved_vacation.approval_user = admin
saved_vacation.save()

# set_notification_request_redis(serializer.data)
response_data: Dict = send_vacation_to_calendar(saved_vacation)
return CustomResponse.success(message=message, data=response_data)
return CustomResponse.bad_request(message="Please make sure that you entered a valid data.", error=serializer.errors)

0 comments on commit 1705d1b

Please sign in to comment.