summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei MIHAI <smihai@entrouvert.com>2014-09-22 14:10:25 (GMT)
committerSerghei MIHAI <smihai@entrouvert.com>2014-09-22 14:10:25 (GMT)
commitbe3ba5b3ddb2edad06261e04b403d17a653dab80 (patch)
treec5b96a0dcaafd19c1e0cb960f6d2ed4b3487469b
parent6ab97b79743b426d5b4b012bac2e99b79963df0e (diff)
downloadcalebasse-be3ba5b3ddb2edad06261e04b403d17a653dab80.zip
calebasse-be3ba5b3ddb2edad06261e04b403d17a653dab80.tar.gz
calebasse-be3ba5b3ddb2edad06261e04b403d17a653dab80.tar.bz2
agenda: current service free periods only displaying fix
-rw-r--r--calebasse/agenda/appointments.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/calebasse/agenda/appointments.py b/calebasse/agenda/appointments.py
index ac7e7e2..c037514 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):