Fix flask send_file arguments

The deprecated attachment_filename was removed in a recent flask release
and is superseded by download_name [1].

[1]: https://github.com/pallets/flask/pull/4667
This commit is contained in:
Thorben Günther 2022-09-26 13:36:56 +02:00 committed by Drew DeVault
parent e1b880e203
commit 2015bd3ca6
2 changed files with 2 additions and 2 deletions

View File

@ -431,4 +431,4 @@ def export_archive(owner_name, list_name):
f = open(path, "rb")
os.unlink(path)
return send_file(f, as_attachment=True,
attachment_filename=f"{owner.username}-{list_name}.mbox")
download_name=f"{owner.username}-{list_name}.mbox")

View File

@ -1,5 +1,5 @@
from flask import Blueprint, render_template, abort, request, redirect, url_for
from flask import current_app, send_file, session
from flask import current_app, session
from srht.config import cfg
from srht.database import db
from srht.flask import paginate_query