mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Use arguments rather than passing around a dict
This makes it harder to write code which will pass tests but fail in real life.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from flask import jsonify
|
||||
from flask import render_template
|
||||
|
||||
from app import performance_dashboard_api_client
|
||||
from app.main import main
|
||||
@@ -8,10 +8,11 @@ from app.main import main
|
||||
|
||||
@main.route("/performance")
|
||||
def performance():
|
||||
api_args = {}
|
||||
|
||||
api_args['start_date'] = (datetime.utcnow() - timedelta(days=90)).date()
|
||||
api_args['end_date'] = datetime.utcnow().date()
|
||||
|
||||
stats = performance_dashboard_api_client.get_performance_dashboard_stats(api_args)
|
||||
return jsonify(stats)
|
||||
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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user