Commit eec1c470 authored by Katia Saurfelt's avatar Katia Saurfelt
Browse files

[web] fix CalendarView : both icalendarable.start and icalendarable.stop dates can be None

--HG--
branch : stable
parent 09454384fff8
......@@ -229,15 +229,15 @@ class CalendarView(EntityView):
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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment