agenda: Look for days with acts not locked only if there are acts not billed.

This commit is contained in:
Mikaël Ates 2013-01-06 14:21:29 +01:00
parent c6242e1284
commit 2e8e4ab040
1 changed files with 3 additions and 2 deletions

View File

@ -358,8 +358,9 @@ class JoursNonVerrouillesView(TemplateView):
acts = Act.objects.filter(is_billed=False,
patient__service=self.service).order_by('date')
days = set(acts.values_list('date', flat=True))
max_day, min_day = max(days), min(days)
days &= set(get_days_with_acts_not_locked(min_day, max_day, self.service))
if days:
max_day, min_day = max(days), min(days)
days &= set(get_days_with_acts_not_locked(min_day, max_day, self.service))
context['days_not_locked'] = days
return context