From c7a7ddf674a6259c85766fad863adb140bd50df3 Mon Sep 17 00:00:00 2001 From: Serghei MIHAI Date: Fri, 26 Sep 2014 15:19:57 +0200 Subject: [PATCH] agenda: availabilities in schedules are service agnostic Closes #5587 --- calebasse/agenda/appointments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calebasse/agenda/appointments.py b/calebasse/agenda/appointments.py index 9dd5cffd..3c0605a5 100644 --- a/calebasse/agenda/appointments.py +++ b/calebasse/agenda/appointments.py @@ -144,7 +144,7 @@ def get_daily_appointments(date, worker, service, time_tables, events, holidays) service_time_tables = [tt for tt in time_tables if service in tt.services.all()] timetables_set = IntervalSet((t.to_interval(date) for t in service_time_tables)) holidays_set = IntervalSet((h.to_interval(date) for h in holidays)) - busy_occurrences_set = IntervalSet((o.to_interval() for o in events if not o.is_event_absence() and service in o.services.all())) + busy_occurrences_set = IntervalSet((o.to_interval() for o in events if not o.is_event_absence())) for free_time in timetables_set - (busy_occurrences_set+holidays_set): if free_time: delta = free_time.upper_bound - free_time.lower_bound