mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Show 2 previous financial years on usage page
From a question on cross-government Slack: > re the Usage tab - currently it shows 3 financial years - last year, > this year and next year. is it possible to replace the "next year" tab > with something more useful? its always going to be blank! I was > thinking it would be good to have 2 financial years ago, 1 financial > year ago and this financial year. This seems like a reasonable idea, and is something we’ve talked about before. The original intention[1] was that seeing your (unchanged) free allowance for next year would be useful, but that doesn’t really seem to be a user need. *** 1. See https://github.com/alphagov/notifications-admin/pull/1094 > so that you can check what your SMS allowance is going to be before > you actually get into it
This commit is contained in:
@@ -142,8 +142,8 @@ def usage(service_id):
|
||||
selected_year=year,
|
||||
years=get_tuples_of_financial_years(
|
||||
partial(url_for, '.usage', service_id=service_id),
|
||||
start=current_financial_year - 1,
|
||||
end=current_financial_year + 1,
|
||||
start=current_financial_year - 2,
|
||||
end=current_financial_year,
|
||||
),
|
||||
**calculate_usage(yearly_usage,
|
||||
free_sms_allowance)
|
||||
@@ -483,5 +483,5 @@ def get_tuples_of_financial_years(
|
||||
partial_url(year=year),
|
||||
'{} to {}'.format(year, year + 1),
|
||||
)
|
||||
for year in range(start, end + 1)
|
||||
for year in reversed(range(start, end + 1))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user