Commit 21b10327 authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Fix PDF generation code flow

parent dc13b2c2
# Changelog # Changelog
## next
- Fix PDF generation code flow
## 0.4.0a6 ## 0.4.0a6
- Add explicit error message on startup if `CONFIG` env variable is not set - Add explicit error message on startup if `CONFIG` env variable is not set
......
...@@ -797,18 +797,16 @@ def pdf_report(): ...@@ -797,18 +797,16 @@ def pdf_report():
) )
return redirect(url_for("home")) return redirect(url_for("home"))
# Send PDF report # Send PDF report
pdf_filename = "Rapport de validation {}.pdf".format( pdf_filename = "Rapport de validation {}.pdf".format(
datetime.now().strftime("%d-%m-%Y %Hh%M") datetime.now().strftime("%d-%m-%Y %Hh%M")
) )
response = make_response(tmp_pdf_report.read_bytes()) response = make_response(tmp_pdf_report.read_bytes())
response.headers.set( response.headers.set("Content-disposition", "attachment", filename=pdf_filename)
"Content-disposition", "attachment", filename=pdf_filename response.headers.set("Content-type", "application/pdf")
) response.headers.set("Content-length", tmp_pdf_report.stat().st_size)
response.headers.set("Content-type", "application/pdf")
response.headers.set("Content-length", tmp_pdf_report.stat().st_size)
return response return response
def extract_schema_metadata(table_schema: frictionless.Schema): def extract_schema_metadata(table_schema: frictionless.Schema):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment