Fix sms allowance switching to live

This commit is contained in:
Andrew Shumway
2023-12-27 14:14:22 -07:00
parent ba0d8c0b83
commit 7f7f553041
2 changed files with 12 additions and 0 deletions

View File

@@ -124,6 +124,14 @@ def service_switch_live(service_id):
if form.validate_on_submit():
current_service.update_status(live=form.enabled.data)
if form.enabled.data is True:
billing_api_client.create_or_update_free_sms_fragment_limit(
service_id, 250000
)
else:
billing_api_client.create_or_update_free_sms_fragment_limit(
service_id, 40000
)
return redirect(url_for(".service_settings", service_id=service_id))
return render_template(

View File

@@ -2323,6 +2323,10 @@ def client_request(logged_in_client, mocker, service_one): # noqa (C901 too com
"app.service_api_client.get_global_notification_count", side_effect=_get
)
mocker.patch(
"app.billing_api_client.create_or_update_free_sms_fragment_limit", autospec=True
)
class ClientRequest:
@staticmethod
@contextmanager