Rework code to ommit unnecessary filter call.
This commit is contained in:
parent
3dfd16558a
commit
9746b3818f
@ -50,9 +50,11 @@ class Overview(TemplateView):
|
|||||||
items = Item.objects.filter(type__exact = 'agd')
|
items = Item.objects.filter(type__exact = 'agd')
|
||||||
|
|
||||||
duration = timedelta()
|
duration = timedelta()
|
||||||
for agenda_item in Item.objects.filter(closed=False):
|
|
||||||
if agenda_item.duration is not None:
|
for item in items:
|
||||||
duration += timedelta(hours=agenda_item.duration.hour, minutes=agenda_item.duration.minute)
|
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']
|
start = config['agenda_start_event_time']
|
||||||
if start is None:
|
if start is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user