mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
sort rest response by org_name, service_name
needed to re-arrange test results for this
This commit is contained in:
@@ -100,4 +100,9 @@ def get_usage_for_all_services():
|
||||
for service_id, breakdown in lb_by_service:
|
||||
combined[service_id]['letter_breakdown'] += (breakdown + '\n')
|
||||
|
||||
return jsonify(list(combined.values()))
|
||||
# sorting first by name == '' means that blank orgs will be sorted last.
|
||||
return jsonify(sorted(combined.values(), key=lambda x: (
|
||||
x['organisation_name'] == '',
|
||||
x['organisation_name'],
|
||||
x['service_name']
|
||||
)))
|
||||
|
||||
Reference in New Issue
Block a user