updated reachables

This commit is contained in:
2025-06-15 22:22:29 +03:00
parent 658a26a123
commit 8573c8021b
7 changed files with 42 additions and 33 deletions

View File

@@ -374,6 +374,8 @@ class Event2Occupant(CrudCollection):
cls.set_session(db)
Service2Events.set_session(db)
Events.set_session(db)
Event2OccupantExtra.set_session(db)
occupant_events = cls.query.filter(cls.build_living_space_id == build_living_space_id).all()
service_ids = list(set([event.event_service_id for event in occupant_events]))
active_event_ids = Service2Events.query.filter(Service2Events.service_id.in_(service_ids)).all()
@@ -409,6 +411,7 @@ class Application2Employee(CrudCollection):
Service2Application.set_session(db)
Applications.set_session(db)
Application2EmployeeExtra.set_session(db)
employee_services = cls.query.filter(cls.employee_id == employee_id).all()
service_ids = [service.service_id for service in employee_services]
active_applications = Service2Application.query.filter(Service2Application.service_id.in_(service_ids)).all()