personnes: no more need to check the empty services attribute

This commit is contained in:
Serghei Mihai 2013-12-12 15:59:05 +01:00
parent 9f39f12f55
commit 14a6b60bb3
1 changed files with 1 additions and 2 deletions

View File

@ -260,8 +260,7 @@ 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(Q(services=service) | Q(services__isnull = True),
worker__isnull=True)
all_holidays = holidays.filter(services=service, worker__isnull=True)
for worker in workers:
holiday_by_worker[worker] = list(all_holidays)