remove uuid and fix downloaded filename

This commit is contained in:
Sébastien Thuret 2021-10-25 12:05:39 +02:00
parent c5f47f0917
commit 9e272cb80c
No known key found for this signature in database
GPG key ID: 4742E2D66933BB08

View file

@ -612,7 +612,6 @@ def create_app(args):
""" """
Download a translated file Download a translated file
""" """
filename.split('.').pop(0)
filepath = os.path.join(get_upload_dir(), filename) filepath = os.path.join(get_upload_dir(), filename)
return_data = io.BytesIO() return_data = io.BytesIO()
@ -620,9 +619,11 @@ def create_app(args):
return_data.write(fo.read()) return_data.write(fo.read())
return_data.seek(0) return_data.seek(0)
print(filename) download_filename = filename.split('.')
download_filename.pop(0)
download_filename = '.'.join(download_filename)
return send_file(return_data, attachment_filename=filename) return send_file(return_data, as_attachment=True, attachment_filename=download_filename)
@app.route("/detect", methods=["POST"]) @app.route("/detect", methods=["POST"])
@access_check @access_check