🐛 Fixed ascii-encoding in headers

This commit is contained in:
Mawoka
2022-12-05 18:19:34 +01:00
parent 1994116410
commit 394887aff6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -270,6 +270,6 @@ async def export_quiz_answers(export_token: str, game_pin: str):
iter_file(),
media_type="application/vnd.ms-excel",
headers={
"Content-Disposition": f"attachment;filename=ClassQuiz-{quiz.title}-{datetime.now().strftime('%m-%d-%Y')}.xlsx" # noqa: E501
"Content-Disposition": f"attachment;filename=ClassQuiz-{quiz.title.encode('ascii', errors='ignore').decode()}-{datetime.now().strftime('%m-%d-%Y')}.xlsx" # noqa: E501
},
)