From 693c6c43598d2af4c4032cc4d2c89d4eb7c1fe8f Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 22 Feb 2022 10:15:05 +0300 Subject: [PATCH] overwrite events without `updated` field --- sync_ics2gcal/sync.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sync_ics2gcal/sync.py b/sync_ics2gcal/sync.py index d37964e..1c56f6d 100644 --- a/sync_ics2gcal/sync.py +++ b/sync_ics2gcal/sync.py @@ -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