Skip to content

Commit e69702f

Browse files
committed
Standardize event IDs
1 parent 80b3da3 commit e69702f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

outlook/indico_outlook/calendar.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
# them and/or modify them under the terms of the MIT License; see
66
# the LICENSE file for more details.
77

8+
from datetime import datetime
89
from pprint import pformat
910

11+
import pytz
1012
import requests
1113
from markupsafe import Markup
1214
from requests.exceptions import RequestException, Timeout
@@ -113,7 +115,11 @@ def _update_calendar_entry(entry, settings):
113115
logger.debug('User %s has disabled calendar entries', user)
114116
return True
115117

116-
unique_id = '{}{}_{}'.format(settings['id_prefix'], user.id, entry.event_id)
118+
# Use common format for event calendar ID if the event was created on or after 2025-04-06
119+
if entry.event.created_dt >= datetime(2025, 4, 6, tzinfo=pytz.UTC):
120+
unique_id = entry.event.ical_uid
121+
else:
122+
unique_id = '{}{}_{}'.format(settings['id_prefix'], user.id, entry.event_id)
117123
path = f'/api/v1/users/{user.email}/events/{unique_id}'
118124
url = settings['service_url'].rstrip('/') + path
119125
if entry.action in {OutlookAction.add, OutlookAction.update}:

0 commit comments

Comments
 (0)