Commit faadeb0d authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Rename pdf report filename

parent e9887775
...@@ -296,8 +296,10 @@ def pdf_report(val_code): ...@@ -296,8 +296,10 @@ def pdf_report(val_code):
tmp_pdf_report.unlink() tmp_pdf_report.unlink()
return redirect(url_for('scdl_validator', val_code=val_code)) return redirect(url_for('scdl_validator', val_code=val_code))
pdf_filename = 'rapport de validation {} {}'.format(val_code,
datetime.now().strftime('%Y-%m-%d %Hh%M'))
response = make_response(tmp_pdf_report.read_bytes()) response = make_response(tmp_pdf_report.read_bytes())
response.headers.set('Content-disposition', 'attachment', filename='report.pdf') response.headers.set('Content-disposition', 'attachment', filename=pdf_filename)
response.headers.set('Content-type', 'application/pdf') response.headers.set('Content-type', 'application/pdf')
response.headers.set('Content-length', tmp_pdf_report.stat().st_size) response.headers.set('Content-length', tmp_pdf_report.stat().st_size)
......
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