Fix error 500 on non-ASCII attachment file names

This commit is contained in:
Raphael Michel
2021-11-09 11:54:44 +01:00
parent b0ae40c264
commit dd0a4df914
3 changed files with 3 additions and 3 deletions

View File

@@ -661,5 +661,5 @@ class AnswerDownload(EventViewMixin, View):
resp['Content-Disposition'] = 'attachment; filename="{}-cart-{}"'.format(
self.request.event.slug.upper(),
os.path.basename(answer.file.name).split('.', 1)[1]
)
).encode("ascii", "ignore")
return resp