Skip to content

Commit 3fe409a

Browse files
marcoaciernoclaude
andcommitted
Use Conference.hostname in .ics export instead of hardcoded host
The favourites-calendar .ics export hardcoded https://2026.pycon.it for the event description Info line and the URL property. Build the URL from the per-conference hostname field (added in #4662) so the link is correct for any conference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c4fa598 commit 3fe409a

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

backend/schedule/tests/test_views.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020

2121
def test_user_schedule_item_favourites_calendar(client):
2222
user = UserFactory()
23-
conference = ConferenceFactory(timezone=zoneinfo.ZoneInfo("Europe/Rome"))
23+
conference = ConferenceFactory(
24+
hostname="2026.pycon.it", timezone=zoneinfo.ZoneInfo("Europe/Rome")
25+
)
2426
second_conf = ConferenceFactory()
2527

2628
schedule_item_1 = ScheduleItemFactory(
@@ -159,7 +161,7 @@ def test_user_schedule_item_favourites_calendar(client):
159161
Language/Lingua: English
160162
Speaker(s)/Relatore(i): Jane Doe, John
161163
Room(s)/Stanza(e): Room Name
162-
Info: https://2026.pycon.it/event/{schedule_item_1.slug}/
164+
Info: https://{conference.hostname}/event/{schedule_item_1.slug}/
163165
""".strip()
164166
)
165167
assert event_schedule_item_1.get("dtstart").dt == datetime(
@@ -182,7 +184,7 @@ def test_user_schedule_item_favourites_calendar(client):
182184
Session format/Formato: Panel
183185
Language/Lingua: Italian
184186
Room(s)/Stanza(e): Another Room
185-
Info: https://2026.pycon.it/event/{schedule_no_speaker.slug}/
187+
Info: https://{conference.hostname}/event/{schedule_no_speaker.slug}/
186188
""".strip()
187189
)
188190

backend/schedule/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def user_schedule_item_favourites_calendar(request, conference_id, hash_user_id)
6060

6161
event_description += f"\nRoom(s)/Stanza(e): {rooms}"
6262

63-
event_description += (
64-
f"\nInfo: https://2026.pycon.it/event/{schedule_item.slug}/"
65-
)
63+
event_url = f"https://{conference.hostname}/event/{schedule_item.slug}/"
64+
65+
event_description += f"\nInfo: {event_url}"
6666

6767
event = Event()
6868
event.add("summary", f"[{conference_name}] {schedule_item.title}")
@@ -77,7 +77,7 @@ def user_schedule_item_favourites_calendar(request, conference_id, hash_user_id)
7777
" ", ""
7878
),
7979
)
80-
event.add("url", f"https://2026.pycon.it/event/{schedule_item.slug}/")
80+
event.add("url", event_url)
8181
event.add(
8282
"dtstart",
8383
schedule_item.start.replace(tzinfo=conference_timezone).astimezone(utc),

0 commit comments

Comments
 (0)