forked from platypush/platypush
Improved robustness of ICal event parser
This commit is contained in:
parent
518d9f20c6
commit
f9f9c38a8b
1 changed files with 8 additions and 6 deletions
|
@ -79,14 +79,16 @@ class CalendarIcalPlugin(Plugin, CalendarInterface):
|
||||||
|
|
||||||
event = self._translate_event(event)
|
event = self._translate_event(event)
|
||||||
|
|
||||||
if event['status'] and event['responseStatus'] \
|
if (
|
||||||
and dateutil.parser.parse(event['end']['dateTime']) >= \
|
event['status'] != 'cancelled'
|
||||||
datetime.datetime.now(pytz.timezone('UTC')) \
|
and event['end']['dateTime']
|
||||||
|
and dateutil.parser.parse(event['end']['dateTime']).replace(tzinfo=pytz.timezone('UTC')) >=
|
||||||
|
datetime.datetime.now(pytz.timezone('UTC'))
|
||||||
and (
|
and (
|
||||||
(only_participating
|
(only_participating
|
||||||
and event['status'] == 'confirmed'
|
and event.get('responseStatus') in [None, 'accepted', 'tentative'])
|
||||||
and event['responseStatus'] in ['accepted', 'tentative'])
|
or not only_participating)
|
||||||
or not only_participating):
|
):
|
||||||
events.append(event)
|
events.append(event)
|
||||||
|
|
||||||
return events
|
return events
|
||||||
|
|
Loading…
Reference in a new issue