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
3 changed files with 7 additions and 3 deletions
Showing only changes of commit bf043f954d - Show all commits

View File

@ -71,7 +71,7 @@
</p>
</div>
<div class="buttons">
<a href="{% url 'export_event_ical' event.id %}" role="button">Exporter ical {% picto_from_name "calendar" %}</a>
<a href="{% url 'export_event_ical' event.start_day.year event.start_day.month event.start_day.day event.id %}" role="button">Exporter ical {% picto_from_name "calendar" %}</a>
{% if perms.agenda_culturel.change_event and not noedit %}
{% include "agenda_culturel/edit-buttons-inc.html" with event=event %}
{% endif %}

View File

@ -158,7 +158,10 @@ urlpatterns = [
UnknownPlaceAddView.as_view(),
name="add_place_to_event",
),
path("event/<int:pk>", export_event_ical, name="export_event_ical"),
path(
"event/<int:year>/<int:month>/<int:day>/<int:pk>/ical",
export_event_ical,
name="export_event_ical"),
]
if settings.DEBUG:

View File

@ -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)