fix export for recurrent events
This commit is contained in:
parent
1a52d02141
commit
bf043f954d
@ -71,7 +71,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<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 %}
|
{% if perms.agenda_culturel.change_event and not noedit %}
|
||||||
{% include "agenda_culturel/edit-buttons-inc.html" with event=event %}
|
{% include "agenda_culturel/edit-buttons-inc.html" with event=event %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -158,7 +158,10 @@ urlpatterns = [
|
|||||||
UnknownPlaceAddView.as_view(),
|
UnknownPlaceAddView.as_view(),
|
||||||
name="add_place_to_event",
|
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:
|
if settings.DEBUG:
|
||||||
|
@ -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 = get_object_or_404(Event, pk=pk)
|
||||||
|
event = event.get_recurrence_at_date(year, month, day)
|
||||||
|
|
||||||
events = list()
|
events = list()
|
||||||
events.append(event)
|
events.append(event)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user