save and confirmed added

This commit is contained in:
2024-11-17 16:30:50 +03:00
parent 7e1b26f3c4
commit 295dbe2cd8
48 changed files with 922 additions and 697 deletions

View File

@@ -68,9 +68,7 @@ class Modules(CrudCollection):
is_default_module = mapped_column(Boolean, server_default="0")
def retrieve_services(self):
services = Services.filter_all(
Services.module_id == self.id
).data
services = Services.filter_all(Services.module_id == self.id).data
if not services:
self.raise_http_exception(
status_code="HTTP_404_NOT_FOUND",
@@ -145,13 +143,9 @@ class Event2Employee(CrudCollection):
@classmethod
def get_event_id_by_employee_id(cls, employee_id) -> (list, list):
active_events = cls.filter_all(
cls.employee_id == employee_id
)
active_events = cls.filter_all(cls.employee_id == employee_id)
active_events_id = [event.event_id for event in active_events.data]
active_events = Events.filter_all(
Events.id.in_(active_events_id)
)
active_events = Events.filter_all(Events.id.in_(active_events_id))
active_events_uu_id = [str(event.uu_id) for event in active_events.data]
return active_events_id, active_events_uu_id
@@ -191,9 +185,7 @@ class Event2Occupant(CrudCollection):
cls.build_living_space_id == build_living_space_id,
).data
active_events_id = [event.event_id for event in active_events]
active_events = Events.filter_all(
Events.id.in_(active_events_id)
).data
active_events = Events.filter_all(Events.id.in_(active_events_id)).data
active_events_uu_id = [str(event.uu_id) for event in active_events]
return active_events_id, active_events_uu_id