Merge pull request #3855 from alphagov/set-annual_billing-in-the-api

Let the API handle setting the default free allowance.
This commit is contained in:
Rebecca Law
2021-04-20 07:17:57 +01:00
committed by GitHub
3 changed files with 2 additions and 24 deletions

View File

@@ -2,7 +2,7 @@ from flask import current_app, redirect, render_template, session, url_for
from flask_login import current_user
from notifications_python_client.errors import HTTPError
from app import billing_api_client, service_api_client
from app import service_api_client
from app.formatters import email_safe
from app.main import main
from app.main.forms import CreateNhsServiceForm, CreateServiceForm
@@ -10,11 +10,6 @@ from app.utils import 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'
][
organisation_type
]
try:
service_id = service_api_client.create_service(
@@ -27,8 +22,6 @@ def _create_service(service_name, organisation_type, email_from, form):
)
session['service_id'] = service_id
billing_api_client.create_or_update_free_sms_fragment_limit(service_id, free_sms_fragment_limit)
return service_id, None
except HTTPError as e:
if e.status_code == 400 and e.message['name']: