From be3ba5b3ddb2edad06261e04b403d17a653dab80 Mon Sep 17 00:00:00 2001 From: Serghei MIHAI Date: Mon, 22 Sep 2014 16:10:25 +0200 Subject: [PATCH] agenda: current service free periods only displaying fix --- calebasse/agenda/appointments.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/calebasse/agenda/appointments.py b/calebasse/agenda/appointments.py index ac7e7e25..c037514a 100644 --- a/calebasse/agenda/appointments.py +++ b/calebasse/agenda/appointments.py @@ -141,7 +141,8 @@ def get_daily_appointments(date, worker, service, time_tables, events, holidays) appointments = [] activity = {'absences': []} - timetables_set = IntervalSet((t.to_interval(date) for t in time_tables)) + service_time_tables = time_tables.filter(services=service) + 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())) for free_time in timetables_set - (busy_occurrences_set+holidays_set):