Files
notifications-admin/app/main/views/performance.py
Chris Hill-Scott 25a6788d66 Use arguments rather than passing around a dict
This makes it harder to write code which will pass tests but fail in
real life.
2021-03-12 14:43:50 +00:00

19 lines
480 B
Python

from datetime import datetime, timedelta
from flask import render_template
from app import performance_dashboard_api_client
from app.main import main
@main.route("/performance")
def performance():
stats = performance_dashboard_api_client.get_performance_dashboard_stats(
start_date=(datetime.utcnow() - timedelta(days=90)).date(),
end_date=datetime.utcnow().date(),
)
return render_template(
'views/performance.html',
**stats
)