[calendar] ensure task.start / task.stop are available before calling todate() tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 14 May 2009 10:13:59 +0200
branchtls-sprint
changeset 1800 05c36cf3c813
parent 1799 183acfaa3cde
child 1801 672acc730ce5
[calendar] ensure task.start / task.stop are available before calling todate()
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]