[FIX] report_xlsx: Fix dynamic report download

This commit is contained in:
Jasmin Solanki
2022-06-24 17:20:54 +05:30
committed by Dario Del Zozzo
parent f3f5131fc0
commit be4f932076

View File

@@ -90,9 +90,10 @@ class ReportController(report.ReportController):
report.print_report_name, {"object": obj, "time": time}
)
filename = "%s.%s" % (report_name, "xlsx")
response.headers.add(
"Content-Disposition", content_disposition(filename)
)
if not response.headers.get("Content-Disposition"):
response.headers.add(
"Content-Disposition", content_disposition(filename)
)
return response
else:
return super(ReportController, self).report_download(data, context)