Skip to content

Commit

Permalink
ics event poster: set a filename
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort committed Aug 29, 2024
1 parent 8b302c4 commit 9beba1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import timedelta
from os.path import splitext

from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
Expand Down Expand Up @@ -195,7 +196,10 @@ def to_ics_event(self) -> IcsEvent:
ics_event.uid = f"event-{self.id}@studibars-ac.de"
ics_event.organizer = Organizer(common_name=self.bar.name, email="[email protected]")
ics_event.url = JSON_LD_BASE_URL + self.url_path()
ics_event.extra.append(ContentLine(name="ATTACH", value=f"{JSON_LD_BASE_URL}{self.poster.url}"))
if self.poster:
_, extension = splitext(self.poster.path)
ics_event.extra.append(ContentLine(name="ATTACH", params={"FILENAME": ["event-poster" + extension]},
value=f"{JSON_LD_BASE_URL}{self.poster.url}"))
ics_event.extra.append(ContentLine(name="X-APPLE-STRUCTURED-LOCATION",
params={
"VALUE": ["URI"],
Expand Down

0 comments on commit 9beba1d

Please sign in to comment.