nettoyage
This commit is contained in:
parent
ce5ff2df63
commit
de61752726
@ -170,11 +170,6 @@ urlpatterns = [
|
||||
name="add_place_to_event",
|
||||
),
|
||||
path("event/<int:pk>", export_event_ical, name="export_event_ical"),
|
||||
path(
|
||||
"events/<int:year>/<int:month>/<int:day>",
|
||||
export_events_ical,
|
||||
name="export_events_ical",
|
||||
),
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user