[web] fix CalendarView : both icalendarable.start and icalendarable.stop dates can be None
--- a/web/views/calendar.py Thu Mar 31 14:23:11 2011 +0200
+++ b/web/views/calendar.py Mon Apr 04 14:10:52 2011 +0200
@@ -229,15 +229,15 @@
events = []
for entity in self.cw_rset.entities():
icalendarable = entity.cw_adapt_to('ICalendarable')
+ if not (icalendarable.start and icalendarable.stop):
+ continue
+ start_date = icalendarable.start or icalendarable.stop
event = {'eid': entity.eid,
'title': entity.view('calendaritem'),
'url': xml_escape(entity.absolute_url()),
'className': 'calevent',
'description': entity.view('tooltip'),
}
- start_date = icalendarable.start
- if not start_date:
- start_date = icalendarable.stop
event['start'] = start_date.strftime('%Y-%m-%dT%H:%M')
event['allDay'] = True
if icalendarable.stop: