updated handler exceptions
This commit is contained in:
@@ -64,7 +64,7 @@ class AccountRecordsListEventMethods(MethodToEvent):
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
if not isinstance(token_dict, OccupantTokenObject):
|
||||
raise AccountRecords().raise_http_exception(
|
||||
raise AccountRecords.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="UNAUTHORIZED",
|
||||
message="Only Occupant can see this data",
|
||||
@@ -76,7 +76,7 @@ class AccountRecordsListEventMethods(MethodToEvent):
|
||||
id=token_dict.selected_occupant.living_space_id
|
||||
).data
|
||||
if not living_space:
|
||||
raise AccountRecords().raise_http_exception(
|
||||
raise AccountRecords.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="UNAUTHORIZED",
|
||||
message="Living space not found",
|
||||
@@ -214,7 +214,7 @@ class AccountRecordsCreateEventMethods(MethodToEvent):
|
||||
BuildIbans.build_id == token_dict.selected_occupant.build_id,
|
||||
).data
|
||||
if not build_iban:
|
||||
BuildIbans.raise_http_exception(
|
||||
raise BuildIbans.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
error_case="UNAUTHORIZED",
|
||||
message=f"{data.iban} is not found in company related to your organization",
|
||||
|
||||
Reference in New Issue
Block a user