Skip to content

Commit

Permalink
as_attachement set to false if no filename provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Ph0tonic committed Nov 19, 2024
1 parent 4103576 commit 612b21d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"[python]":{
"editor.formatOnSave": false
}
}
2 changes: 1 addition & 1 deletion flask_weasyprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,6 @@ def render_pdf(html, stylesheets=None, download_filename=None,
return send_file(
BytesIO(pdf),
mimetype="application/pdf",
as_attachment=automatic_download,
as_attachment= False if not download_filename else automatic_download,
download_name=download_filename,
)

0 comments on commit 612b21d

Please sign in to comment.