auth endpoints added

This commit is contained in:
2025-04-03 14:19:34 +03:00
parent 3583d178e9
commit ee405133be
37 changed files with 976 additions and 570 deletions

View File

@@ -110,9 +110,7 @@ class Services(CrudCollection):
def retrieve_service_via_occupant_code(cls, occupant_code):
with cls.new_session() as db_session:
occupant_type = OccupantTypes.filter_by_one(
system=True,
occupant_code=occupant_code,
db=db_session
system=True, occupant_code=occupant_code, db=db_session
).data
if not occupant_type:
cls.raise_http_exception(
@@ -124,8 +122,7 @@ class Services(CrudCollection):
},
)
return cls.filter_one(
cls.related_responsibility == occupant_type.occupant_code,
db=db_session
cls.related_responsibility == occupant_type.occupant_code, db=db_session
).data
__table_args__ = ({"comment": "Services Information"},)