From bf043f954da3f248c43ce6b3ba177f6d02334515 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sat, 1 Jun 2024 10:52:24 +0200 Subject: [PATCH] fix export for recurrent events --- .../agenda_culturel/single-event/event-single-inc.html | 2 +- src/agenda_culturel/urls.py | 5 ++++- src/agenda_culturel/views.py | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/agenda_culturel/templates/agenda_culturel/single-event/event-single-inc.html b/src/agenda_culturel/templates/agenda_culturel/single-event/event-single-inc.html index ce14523..d29e73a 100644 --- a/src/agenda_culturel/templates/agenda_culturel/single-event/event-single-inc.html +++ b/src/agenda_culturel/templates/agenda_culturel/single-event/event-single-inc.html @@ -71,7 +71,7 @@

- Exporter ical {% picto_from_name "calendar" %} + Exporter ical {% picto_from_name "calendar" %} {% if perms.agenda_culturel.change_event and not noedit %} {% include "agenda_culturel/edit-buttons-inc.html" with event=event %} {% endif %} diff --git a/src/agenda_culturel/urls.py b/src/agenda_culturel/urls.py index 9ff32f5..695051e 100644 --- a/src/agenda_culturel/urls.py +++ b/src/agenda_culturel/urls.py @@ -158,7 +158,10 @@ urlpatterns = [ UnknownPlaceAddView.as_view(), name="add_place_to_event", ), - path("event/", export_event_ical, name="export_event_ical"), + path( + "event/////ical", + export_event_ical, + name="export_event_ical"), ] if settings.DEBUG: diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index fb56d95..29a0d9d 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -598,8 +598,9 @@ def import_from_url(request): ) -def export_event_ical(request, pk): +def export_event_ical(request, year, month, day, pk): event = get_object_or_404(Event, pk=pk) + event = event.get_recurrence_at_date(year, month, day) events = list() events.append(event)