From 6940716fea148bec81465698a8798669ae757441 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Wed, 5 Oct 2022 19:21:08 +0200 Subject: [PATCH] :sparkles: Added Date into export-file-name --- classquiz/routers/quiz.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classquiz/routers/quiz.py b/classquiz/routers/quiz.py index 62f1ac2..901e78d 100644 --- a/classquiz/routers/quiz.py +++ b/classquiz/routers/quiz.py @@ -270,5 +270,7 @@ async def export_quiz_answers(export_token: str, game_pin: str): return StreamingResponse( iter_file(), media_type="application/vnd.ms-excel", - headers={"Content-Disposition": f"attachment;filename=ClassQuiz-{quiz.title}.xlsx"}, + headers={ + "Content-Disposition": f"attachment;filename=ClassQuiz-{quiz.title}-{datetime.now().strftime('%m-%d-%Y')}.xlsx" # noqa: E501 + }, )