From 0530441452e7495088ca5cd59725b841c777eac0 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sat, 2 Mar 2024 19:44:35 +0100 Subject: [PATCH] Fix receipt file name Signed-off-by: Emmy D'Anello --- registration/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/registration/views.py b/registration/views.py index 30b9eef..e74c337 100644 --- a/registration/views.py +++ b/registration/views.py @@ -767,7 +767,8 @@ class ReceiptView(LoginRequiredMixin, View): mime_type = mime.from_file(path) ext = mime_type.split("/")[1].replace("jpeg", "jpg") # Replace file name - true_file_name = _("Payment receipt of {user}.{ext}").format(user=str(user.registration), ext=ext) + registrations = ", ".join(str(registration) for registration in payment.registrations.all()) + true_file_name = _("Payment receipt of {registrations}.{ext}").format(registrations=registrations, ext=ext) return FileResponse(open(path, "rb"), content_type=mime_type, filename=true_file_name)