Rework code to ommit unnecessary filter call.

This commit is contained in:
Stefan Frauenknecht 2013-01-31 20:32:29 +01:00
parent 3dfd16558a
commit 9746b3818f

View File

@ -50,9 +50,11 @@ class Overview(TemplateView):
items = Item.objects.filter(type__exact = 'agd')
duration = timedelta()
for agenda_item in Item.objects.filter(closed=False):
if agenda_item.duration is not None:
duration += timedelta(hours=agenda_item.duration.hour, minutes=agenda_item.duration.minute)
for item in items:
if not item.closed and item.duration is not None:
duration += timedelta(hours=item.duration.hour,
minutes=item.duration.minute)
start = config['agenda_start_event_time']
if start is None: