personnes: showing the services common holidays for each service

Closes #4105
This commit is contained in:
Serghei Mihai 2013-12-12 14:25:51 +01:00
parent b4e251576d
commit d29317d341
No known key found for this signature in database
GPG Key ID: 76D1C964BF2FA1AF
1 changed files with 2 additions and 1 deletions

View File

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