Verified Commit f9f9c38a authored by Fabio Manganiello's avatar Fabio Manganiello
Browse files

Improved robustness of ICal event parser

parent 518d9f20
Pipeline #110 passed with stages
in 6 minutes and 34 seconds
......@@ -79,14 +79,16 @@ class CalendarIcalPlugin(Plugin, CalendarInterface):
event = self._translate_event(event)
if event['status'] and event['responseStatus'] \
and dateutil.parser.parse(event['end']['dateTime']) >= \'UTC')) \
if (
event['status'] != 'cancelled'
and event['end']['dateTime']
and dateutil.parser.parse(event['end']['dateTime']).replace(tzinfo=pytz.timezone('UTC')) >='UTC'))
and (
and event['status'] == 'confirmed'
and event['responseStatus'] in ['accepted', 'tentative'])
or not only_participating):
and event.get('responseStatus') in [None, 'accepted', 'tentative'])
or not only_participating)
return events
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