On corrige le problèmes des nouvelles lignes dans les noms des fichiers ical

This commit is contained in:
Jean-Marie Favreau 2025-01-15 22:24:52 +01:00
parent 3cf874224f
commit 0542e3a695

View File

@ -809,7 +809,7 @@ def export_event_ical(request, year, month, day, pk):
response = HttpResponse(content_type="text/calendar") response = HttpResponse(content_type="text/calendar")
response.content = cal.to_ical().decode("utf-8").replace("\r\n", "\n") response.content = cal.to_ical().decode("utf-8").replace("\r\n", "\n")
response["Content-Disposition"] = "attachment; filename={0}{1}".format( response["Content-Disposition"] = "attachment; filename={0}{1}".format(
event.title, ".ics" event.title.replace('\n', ' ').replace('\r', '')[0:32], ".ics"
) )
return response return response