mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-06 06:20:53 -04:00
Minor tweaks in response to PR comments
In response to [^1] and [^2]. [^1]: https://github.com/alphagov/notifications-admin/pull/4229#discussion_r869181152 [^2]: https://github.com/alphagov/notifications-admin/pull/4229#discussion_r869186063
This commit is contained in:
@@ -423,6 +423,10 @@ def get_monthly_usage_breakdown_for_letters(monthly_letters):
|
||||
postage_order[get_monthly_usage_postage_description(row)], row['rate']
|
||||
)
|
||||
|
||||
# First sort letter rows by postage and then by rate, clumping "europe" and
|
||||
# "rest-of-world" postage together as "international". Group the sorted rows
|
||||
# together using the same fields - "group_key" is used for both operations.
|
||||
# Note that "groupby" preserves the sort order in the groups it returns.
|
||||
rate_groups = groupby(sorted(monthly_letters, key=group_key), key=group_key)
|
||||
|
||||
for _key, rate_group in rate_groups:
|
||||
|
||||
Reference in New Issue
Block a user