mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 13:52:17 +01:00 
			
		
		
		
	Fix receipt file name
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
		@@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user