mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-24 17:02:24 +00:00
Fix receipt file name
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
4ff53e08db
commit
0530441452
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user