mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-07 03:48:26 -04:00
remove unneccessary str cast
This commit is contained in:
@@ -80,11 +80,11 @@ def get_usage_for_all_services():
|
|||||||
"letter_cost": 0,
|
"letter_cost": 0,
|
||||||
"letter_breakdown": ""
|
"letter_breakdown": ""
|
||||||
}
|
}
|
||||||
combined[str(s.service_id)] = entry
|
combined[s.service_id] = entry
|
||||||
|
|
||||||
for l in letter_costs:
|
for l in letter_costs:
|
||||||
if l.service_id in combined:
|
if l.service_id in combined:
|
||||||
combined[str(l.service_id)].update({'letter_cost': l.letter_cost})
|
combined[l.service_id].update({'letter_cost': l.letter_cost})
|
||||||
else:
|
else:
|
||||||
letter_entry = {
|
letter_entry = {
|
||||||
"organisation_id": str(l.organisation_id) if l.organisation_id else "",
|
"organisation_id": str(l.organisation_id) if l.organisation_id else "",
|
||||||
@@ -96,8 +96,8 @@ def get_usage_for_all_services():
|
|||||||
"letter_cost": float(l.letter_cost),
|
"letter_cost": float(l.letter_cost),
|
||||||
"letter_breakdown": ""
|
"letter_breakdown": ""
|
||||||
}
|
}
|
||||||
combined[str(l.service_id)] = letter_entry
|
combined[l.service_id] = letter_entry
|
||||||
for service_id, breakdown in lb_by_service:
|
for service_id, breakdown in lb_by_service:
|
||||||
combined[str(service_id)]['letter_breakdown'] += (breakdown + '\n')
|
combined[service_id]['letter_breakdown'] += (breakdown + '\n')
|
||||||
|
|
||||||
return jsonify(list(combined.values()))
|
return jsonify(list(combined.values()))
|
||||||
|
|||||||
Reference in New Issue
Block a user