Fixed if condition with duration property which can be None

This commit is contained in:
Stefan Frauenknecht 2013-02-16 11:55:40 +01:00
parent 8103c09b81
commit 1d1d72d45a

View File

@ -58,7 +58,8 @@ class Overview(TemplateView):
duration = timedelta()
for item in items:
if not item.closed and len(item.duration) > 0:
if not item.closed and (item.duration is not None
and len(item.duration) > 0):
duration_list = item.duration.split(':')
duration += timedelta(hours=int(duration_list[0]),
minutes=int(duration_list[1]))