|
5 | 5 | # them and/or modify them under the terms of the MIT License; see
|
6 | 6 | # the LICENSE file for more details.
|
7 | 7 |
|
| 8 | +from datetime import datetime |
8 | 9 | from pprint import pformat
|
| 10 | +from urllib.parse import urlsplit |
9 | 11 |
|
10 | 12 | import requests
|
11 | 13 | from markupsafe import Markup
|
|
14 | 16 | from werkzeug.datastructures import MultiDict
|
15 | 17 |
|
16 | 18 | from indico.core import signals
|
| 19 | +from indico.core.config import config |
17 | 20 | from indico.core.db import db
|
18 | 21 | from indico.util.signals import values_from_signal
|
19 | 22 | from indico.util.string import strip_control_chars
|
@@ -113,7 +116,11 @@ def _update_calendar_entry(entry, settings):
|
113 | 116 | logger.debug('User %s has disabled calendar entries', user)
|
114 | 117 | return True
|
115 | 118 |
|
116 |
| - unique_id = '{}{}_{}'.format(settings['id_prefix'], user.id, entry.event_id) |
| 119 | + # Use common format for event calendar ID if the event was created on or after 2025-04-01 |
| 120 | + if entry.event.created_dt >= datetime(2025, 4, 1): |
| 121 | + unique_id = f'indico-event-{entry.event_id}@{urlsplit(config.BASE_URL).hostname}' |
| 122 | + else: |
| 123 | + unique_id = '{}{}_{}'.format(settings['id_prefix'], user.id, entry.event_id) |
117 | 124 | path = f'/api/v1/users/{user.email}/events/{unique_id}'
|
118 | 125 | url = settings['service_url'].rstrip('/') + path
|
119 | 126 | if entry.action in {OutlookAction.add, OutlookAction.update}:
|
|
0 commit comments