feat: Download a csv for the report
All checks were successful
Build Docker / Build Image (push) Successful in 57s

This commit is contained in:
Nathan Woodburn 2024-02-17 11:57:04 +11:00
parent 43c5b5c3ba
commit b85d316491
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 8 additions and 2 deletions

View File

@ -26,7 +26,7 @@ python3 main.py
On Windows: On Windows:
```bash ```bash
python main.py python3 main.py
``` ```

View File

@ -1237,8 +1237,14 @@ def report():
return redirect("/login") return redirect("/login")
account = account_module.check_account(request.cookies.get("account")) 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 #endregion