From de6175272635503d88bb9b2c865230c9a14a7189 Mon Sep 17 00:00:00 2001 From: SebF Date: Sun, 19 May 2024 17:17:15 +0200 Subject: [PATCH] nettoyage --- src/agenda_culturel/urls.py | 5 ----- src/agenda_culturel/views.py | 18 +----------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/agenda_culturel/urls.py b/src/agenda_culturel/urls.py index c47bfb4..118b6cd 100644 --- a/src/agenda_culturel/urls.py +++ b/src/agenda_culturel/urls.py @@ -170,11 +170,6 @@ urlpatterns = [ name="add_place_to_event", ), path("event/", export_event_ical, name="export_event_ical"), - path( - "events///", - export_events_ical, - name="export_events_ical", - ), ] if settings.DEBUG: diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 0317502..a787f8a 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -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 +from django.http import HttpResponseRedirect from django.urls import reverse from collections import Counter @@ -643,22 +643,6 @@ def export_event_ical(request, pk): return response -def export_events_ical(request, year, month, day): - cday = CalendarDay(date(year, month, day)) - - events = cday.get_events() - - cal = Event.export_to_ics(events) - - response = HttpResponse(content_type="text/calendar") - response.content = cal.to_ical().decode("utf-8").replace("\r\n", "\n") - response["Content-Disposition"] = "attachment; filename={0}{1}".format( - "tutu", ".ics" - ) - - return response - - class EventFilterAdmin(django_filters.FilterSet): status = django_filters.MultipleChoiceFilter( choices=Event.STATUS.choices, widget=forms.CheckboxSelectMultiple