1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-11-22 01:21:01 +00:00

fix compatibility to pretalx 2.3.1

This commit is contained in:
Franzi 2022-11-07 06:29:08 +01:00
parent 9634838c0f
commit 76f615862f
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -77,6 +77,13 @@ class PDFInfoPage(Flowable):
self._add(Spacer(1, PAGE_PADDING / 2)) self._add(Spacer(1, PAGE_PADDING / 2))
def draw(self): def draw(self):
if hasattr(self.talk, 'local_start'):
talk_start = self.talk.local_start
talk_end = self.talk.local_end
else:
talk_start = self.talk.start.astimezone(self.event.tz)
talk_end = self.talk.end.astimezone(self.event.tz)
# add some information horizontally to the side of the page # add some information horizontally to the side of the page
self.canv.saveState() self.canv.saveState()
self.canv.rotate(90) self.canv.rotate(90)
@ -89,7 +96,7 @@ class PDFInfoPage(Flowable):
self.talk.submission.code, self.talk.submission.code,
str(self.talk.submission.submission_type.name), str(self.talk.submission.submission_type.name),
str(self.event.name), str(self.event.name),
self.talk.local_start.isoformat(), talk_start.isoformat(),
f"Day {self.day['index']}", f"Day {self.day['index']}",
str(self.room["name"]), str(self.room["name"]),
f"Schedule {self.schedule.version}", f"Schedule {self.schedule.version}",
@ -111,7 +118,7 @@ class PDFInfoPage(Flowable):
[ [
str(self.event.name), str(self.event.name),
str(self.room["name"]), str(self.room["name"]),
self.talk.local_start.strftime("%F %T"), talk_start.strftime("%F %T"),
], ],
), ),
style=self.style["Meta"], style=self.style["Meta"],