personnes: group holidays displayed by service

Closes #4105
This commit is contained in:
Serghei Mihai 2013-12-12 14:02:57 +01:00
parent 2bffdbe44a
commit b4e251576d
1 changed files with 2 additions and 1 deletions

View File

@ -259,7 +259,8 @@ class HolidayView(cbv.TemplateView, cbv.ServiceViewMixin):
start_date__lte=filter_end_date) \
.select_related('worker', 'service')
holiday_by_worker = defaultdict(lambda: [])
all_holidays = holidays.filter(worker__isnull=True)
service = Service.objects.get(slug = ctx['service'])
all_holidays = holidays.filter(worker__isnull=True, services=service)
for worker in workers:
holiday_by_worker[worker] = list(all_holidays)