feat: Download a csv for the report

This commit is contained in:
2024-02-17 11:57:04 +11:00
parent 43c5b5c3ba
commit b85d316491
2 changed files with 8 additions and 2 deletions

View File

@@ -1237,8 +1237,14 @@ def report():
return redirect("/login")
account = account_module.check_account(request.cookies.get("account"))
csv = '\n'.join(account_module.generateReport(account))
# Create a download
return jsonify(account_module.generateReport(account))
response = make_response(csv)
response.headers["Content-Disposition"] = "attachment; filename=report.csv"
response.headers["Content-Type"] = "text/csv"
return response
#endregion