Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Validata
Validata UI
Commits
faadeb0d
Commit
faadeb0d
authored
Nov 30, 2018
by
Pierre Dittgen
Browse files
Rename pdf report filename
parent
e9887775
Changes
1
Hide whitespace changes
Inline
Side-by-side
validata_ui/views.py
View file @
faadeb0d
...
...
@@ -296,8 +296,10 @@ def pdf_report(val_code):
tmp_pdf_report
.
unlink
()
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
.
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-length'
,
tmp_pdf_report
.
stat
().
st_size
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment