mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
Change config structure so allowances are dated
We’re going to have different allowances next financial year. This means that when someone adds a service, we’ll need to check which year it is, so we can give them the right allowance. This commit changes the config structure so that the current allowances are explicitly assigned to the 2020/21 financial year. It freezes the tests to the 2020/21 financial year, so they won’t start failing automatically when next financial year comes around.
This commit is contained in:
@@ -6,11 +6,21 @@ from app import billing_api_client, service_api_client
|
||||
from app.formatters import email_safe
|
||||
from app.main import main
|
||||
from app.main.forms import CreateNhsServiceForm, CreateServiceForm
|
||||
from app.utils import user_is_gov_user, user_is_logged_in
|
||||
from app.utils import (
|
||||
get_current_financial_year,
|
||||
user_is_gov_user,
|
||||
user_is_logged_in,
|
||||
)
|
||||
|
||||
|
||||
def _create_service(service_name, organisation_type, email_from, form):
|
||||
free_sms_fragment_limit = current_app.config['DEFAULT_FREE_SMS_FRAGMENT_LIMITS'].get(organisation_type)
|
||||
free_sms_fragment_limit = current_app.config[
|
||||
'DEFAULT_FREE_SMS_FRAGMENT_LIMITS'
|
||||
][
|
||||
organisation_type
|
||||
][
|
||||
get_current_financial_year()
|
||||
]
|
||||
|
||||
try:
|
||||
service_id = service_api_client.create_service(
|
||||
|
||||
Reference in New Issue
Block a user