overwrite events without `updated` field

This commit is contained in:
Dmitry Belyaev 2022-02-22 10:15:05 +03:00
parent b09136747f
commit 693c6c4359
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3
1 changed files with 2 additions and 0 deletions

View File

@ -72,6 +72,8 @@ class CalendarSync:
def filter_updated(event_tuple: EventTuple) -> bool:
new, old = event_tuple
if 'updated' not in new or 'updated' not in old:
return True
new_date = dateutil.parser.parse(new['updated'])
old_date = dateutil.parser.parse(old['updated'])
return new_date > old_date