updated handler exceptions

This commit is contained in:
2025-01-11 19:40:10 +03:00
parent cecf1e69a2
commit 56b693989d
34 changed files with 571 additions and 1126 deletions

View File

@@ -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",