From: Matthew Vernon Date: Fri, 19 Oct 2018 11:41:54 +0000 (+0100) Subject: only register gcal_link if necessary X-Git-Tag: v0.1~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?p=gooswapper;a=commitdiff_plain;h=3ab26f0d9fff9530325a1c227f4f2e8da81b6f58 only register gcal_link if necessary --- diff --git a/gooswapper.py b/gooswapper.py index f3c73a0..75edd3f 100644 --- a/gooswapper.py +++ b/gooswapper.py @@ -54,7 +54,10 @@ class ex_gcal_link(exchangelib.ExtendedProperty): property_name = "google calendar event id" property_type = 'String' -exchangelib.CalendarItem.register('gcal_link',ex_gcal_link) +try: + exchangelib.CalendarItem.get_field_by_fieldname('gcal_link') +except ValueError: + exchangelib.CalendarItem.register('gcal_link',ex_gcal_link) #useful if you want to replay an event def drop_from_ex_cache(itemid):