mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Fixing things is fun.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -125,11 +125,7 @@ def get_jobs_by_service(service_id):
|
||||
try:
|
||||
limit_days = int(request.args["limit_days"])
|
||||
except ValueError:
|
||||
errors = {
|
||||
"limit_days": [
|
||||
f"{request.args['limit_days']} is not an integer"
|
||||
]
|
||||
}
|
||||
errors = {"limit_days": [f"{request.args['limit_days']} is not an integer"]}
|
||||
raise InvalidRequest(errors, status_code=400)
|
||||
else:
|
||||
limit_days = None
|
||||
|
||||
@@ -85,7 +85,13 @@ def transform_results_into_totals(total_notifications_results):
|
||||
def transform_into_notification_by_type_json(total_notifications):
|
||||
j = []
|
||||
for x in total_notifications:
|
||||
j.append({"date": x.local_date.strftime("%Y-%m-%d"), "emails": x.emails, "sms": x.sms})
|
||||
j.append(
|
||||
{
|
||||
"date": x.local_date.strftime("%Y-%m-%d"),
|
||||
"emails": x.emails,
|
||||
"sms": x.sms,
|
||||
}
|
||||
)
|
||||
|
||||
return j
|
||||
|
||||
|
||||
Reference in New Issue
Block a user