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
21b10327
Commit
21b10327
authored
Jan 08, 2021
by
Pierre Dittgen
Browse files
Fix PDF generation code flow
parent
dc13b2c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
21b10327
# 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
...
...
validata_ui/views.py
View file @
21b10327
...
@@ -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
):
...
...
Pierre Dittgen
@pdi
mentioned in issue
#71 (closed)
·
Jan 08, 2021
mentioned in issue
#71 (closed)
mentioned in issue #71
Toggle commit list
Write
Preview
Markdown
is supported
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