From ed960358a486e2373820a020e97d1bbc8c334a94 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 3 Nov 2024 12:56:24 +0100 Subject: [PATCH] placeholders: what we actually want is `schedule.event` here --- pretalx_broadcast_tools/exporter.py | 2 +- pretalx_broadcast_tools/utils/placeholders.py | 8 ++++---- pretalx_broadcast_tools/views/schedule.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pretalx_broadcast_tools/exporter.py b/pretalx_broadcast_tools/exporter.py index 22ae82d..9d22788 100644 --- a/pretalx_broadcast_tools/exporter.py +++ b/pretalx_broadcast_tools/exporter.py @@ -201,7 +201,7 @@ class PDFInfoPage(Flowable): self._add( Paragraph( self.event.settings.broadcast_tools_pdf_additional_content.format( - **placeholders(self.schedule, self.talk) + **placeholders(self.schedule.event, self.talk) ), style=self.style["Meta"], ) diff --git a/pretalx_broadcast_tools/utils/placeholders.py b/pretalx_broadcast_tools/utils/placeholders.py index 6a1ce16..75ad335 100644 --- a/pretalx_broadcast_tools/utils/placeholders.py +++ b/pretalx_broadcast_tools/utils/placeholders.py @@ -1,19 +1,19 @@ from django.conf import settings -def placeholders(schedule, talk, supports_html_colour=False): +def placeholders(event, talk, supports_html_colour=False): track_name = str(talk.submission.track.name) if talk.submission.track else "" result = { "CODE": talk.submission.code, - "EVENT_SLUG": str(schedule.event.slug), + "EVENT_SLUG": str(event.slug), "FEEDBACK_URL": "{}{}".format( - schedule.event.custom_domain or settings.SITE_URL, + event.custom_domain or settings.SITE_URL, talk.submission.urls.feedback, ), "TALK_SLUG": talk.frab_slug, "TALK_URL": "{}{}".format( - schedule.event.custom_domain or settings.SITE_URL, + event.custom_domain or settings.SITE_URL, talk.submission.urls.public, ), "TRACK_NAME": track_name, diff --git a/pretalx_broadcast_tools/views/schedule.py b/pretalx_broadcast_tools/views/schedule.py index f838489..6a80d40 100644 --- a/pretalx_broadcast_tools/views/schedule.py +++ b/pretalx_broadcast_tools/views/schedule.py @@ -64,7 +64,7 @@ class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, View): "room": room["name"].localize(schedule.event.locale), "infoline": infoline.format( **placeholders( - schedule, talk, supports_html_colour=True + schedule.event, talk, supports_html_colour=True ) ), "image_url": talk.submission.image_url,