updated handler exceptions
This commit is contained in:
@@ -79,7 +79,7 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
|
||||
system=True,
|
||||
).data
|
||||
if not endpoint:
|
||||
EndpointRestriction.raise_http_exception(
|
||||
raise EndpointRestriction.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="UNAUTHORIZED",
|
||||
message="Only Occupant can see this data",
|
||||
@@ -94,7 +94,7 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
|
||||
== token_dict.selected_occupant.living_space_id,
|
||||
).data
|
||||
if not event_occupant:
|
||||
EndpointRestriction.raise_http_exception(
|
||||
raise EndpointRestriction.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="UNAUTHORIZED",
|
||||
message="This endpoint is not available for this occupant",
|
||||
@@ -110,7 +110,7 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
|
||||
Event2Employee.employee_id == token_dict.selected_company.employee_id,
|
||||
).data
|
||||
if not event_employee:
|
||||
EndpointRestriction.raise_http_exception(
|
||||
raise EndpointRestriction.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="UNAUTHORIZED",
|
||||
message="This endpoint is not available for this employee",
|
||||
|
||||
Reference in New Issue
Block a user