# HG changeset patch # User Adrien Di Mascio # Date 1242288839 -7200 # Node ID 05c36cf3c81303b635932c5a89f3f948ff094c1b # Parent 183acfaa3cde552f8a0c4a80f1f0afc3974f155f [calendar] ensure task.start / task.stop are available before calling todate() diff -r 183acfaa3cde -r 05c36cf3c813 web/views/calendar.py --- a/web/views/calendar.py Thu May 14 08:35:19 2009 +0200 +++ b/web/views/calendar.py Thu May 14 10:13:59 2009 +0200 @@ -164,13 +164,15 @@ else: user = None the_dates = [] - tstart = todate(task.start) + tstart = task.start if tstart: + tstart = todate(task.start) if tstart > lastday: continue the_dates = [tstart] - tstop = todate(task.start) + tstop = task.stop if tstop: + tstop = todate(tstop) if tstop < firstday: continue the_dates = [tstop] @@ -348,13 +350,15 @@ continue done_tasks.append(task) the_dates = [] - tstart = todate(task.start) - tstop = todate(task.stop) + tstart = task.start + tstop = task.stop if tstart: + tstart = todate(tstart) if tstart > lastday: continue the_dates = [tstart] if tstop: + tstop = todate(tstop) if tstop < firstday: continue the_dates = [tstop]