feat: Download a csv for the report
All checks were successful
Build Docker / Build Image (push) Successful in 57s
All checks were successful
Build Docker / Build Image (push) Successful in 57s
This commit is contained in:
parent
43c5b5c3ba
commit
b85d316491
@ -26,7 +26,7 @@ python3 main.py
|
||||
|
||||
On Windows:
|
||||
```bash
|
||||
python main.py
|
||||
python3 main.py
|
||||
```
|
||||
|
||||
|
||||
|
8
main.py
8
main.py
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user