From 6aa3310cc4dca3e8520934e26b9dde2464d76da3 Mon Sep 17 00:00:00 2001 From: Serghei MIHAI Date: Mon, 22 Sep 2014 17:33:41 +0200 Subject: [PATCH] agenda: handling cases when service time tables are not queryset --- 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 c037514a..f80d5e1b 100644 --- a/calebasse/agenda/appointments.py +++ b/calebasse/agenda/appointments.py @@ -141,7 +141,7 @@ def get_daily_appointments(date, worker, service, time_tables, events, holidays) appointments = [] activity = {'absences': []} - service_time_tables = time_tables.filter(services=service) + 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()))