13_export_ical_event #116

Merged
jmtrivial merged 5 commits from 13_export_ical_event into main 2024-06-01 10:53:50 +02:00
2 changed files with 8 additions and 5 deletions
Showing only changes of commit 59d93cf686 - Show all commits

View File

@ -1123,7 +1123,9 @@ class Event(models.Model):
)
eventIcal.add("summary", event.title)
eventIcal.add("name", event.title)
eventIcal.add("description", event.description + "\r" + event.reference_urls[0])
eventIcal.add(
"description", event.description + "\r" + event.reference_urls[0]
)
eventIcal.add("location", event.exact_location or event.location)
cal.add_component(eventIcal)

View File

@ -10,7 +10,7 @@ from django.http import QueryDict
from django import forms
from django.contrib.postgres.search import SearchQuery, SearchHeadline
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseNotFound, FileResponse
from django.http import HttpResponseRedirect, FileResponse
from django.urls import reverse
from collections import Counter
@ -608,9 +608,10 @@ def export_event_ical(request, pk):
return FileResponse(
cal.to_ical().decode("utf-8").replace("\r\n", "\n"),
as_attachment=True,
filename= event.title + ".ics",
content_type="text/calendar")
as_attachment=True,
filename=event.title + ".ics",
content_type="text/calendar",
)
class EventFilterAdmin(django_filters.FilterSet):