test application updated@build living space

This commit is contained in:
2024-11-15 19:23:08 +03:00
parent d2cc195ccf
commit 7e1b26f3c4
44 changed files with 261 additions and 321 deletions

View File

@@ -69,7 +69,7 @@ class Modules(CrudCollection):
def retrieve_services(self):
services = Services.filter_all(
Services.module_id == self.id, *Services.valid_record_args(Services)
Services.module_id == self.id
).data
if not services:
self.raise_http_exception(
@@ -146,11 +146,11 @@ 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, *cls.valid_record_args(cls)
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), *Events.valid_record_args(Events)
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
@@ -189,11 +189,10 @@ class Event2Occupant(CrudCollection):
) -> (list, list):
active_events = cls.filter_all(
cls.build_living_space_id == build_living_space_id,
*cls.valid_record_args(cls),
).data
active_events_id = [event.event_id for event in active_events]
active_events = Events.filter_all(
Events.id.in_(active_events_id), *Events.valid_record_args(Events)
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