mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-30 02:50:03 -04:00
Updated service settings for international sms
This commit is contained in:
@@ -192,6 +192,17 @@ def service_switch_can_send_letters(service_id):
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/can-send-international-sms")
|
||||
@login_required
|
||||
@user_has_permissions(admin_override=True)
|
||||
def service_switch_can_send_international_sms(service_id):
|
||||
service_api_client.update_service_with_properties(
|
||||
service_id,
|
||||
{"can_send_international_sms": not current_service['can_send_international_sms']}
|
||||
)
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/archive", methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@user_has_permissions('manage_settings', admin_override=True)
|
||||
|
||||
@@ -87,6 +87,7 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
'reply_to_email_address',
|
||||
'research_mode',
|
||||
'can_send_letters',
|
||||
'can_send_international_sms',
|
||||
'sms_sender',
|
||||
'created_by',
|
||||
'branding',
|
||||
|
||||
@@ -126,6 +126,11 @@
|
||||
{{ 'Stop sending letters' if current_service.can_send_letters else 'Allow to send letters' }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="bottom-gutter">
|
||||
<a href="{{ url_for('.service_switch_can_send_international_sms', service_id=current_service.id) }}" class="button">
|
||||
{{ 'Stop sending international sms' if current_service.can_send_international_sms else 'Allow to send international sms' }}
|
||||
</a>
|
||||
</li>
|
||||
{% if current_service.active %}
|
||||
<li class="bottom-gutter">
|
||||
<a href="{{ url_for('.archive_service', service_id=current_service.id) }}" class="button">
|
||||
|
||||
@@ -50,6 +50,7 @@ def service_json(
|
||||
sms_sender=None,
|
||||
research_mode=False,
|
||||
can_send_letters=False,
|
||||
can_send_international_sms=False,
|
||||
organisation=None,
|
||||
branding='govuk',
|
||||
created_at=None,
|
||||
@@ -69,6 +70,7 @@ def service_json(
|
||||
'sms_sender': sms_sender,
|
||||
'research_mode': research_mode,
|
||||
'can_send_letters': can_send_letters,
|
||||
'can_send_international_sms': can_send_international_sms,
|
||||
'organisation': organisation,
|
||||
'branding': branding,
|
||||
'created_at': created_at or str(datetime.utcnow()),
|
||||
|
||||
@@ -417,6 +417,7 @@ def test_route_permissions(
|
||||
'main.service_switch_live',
|
||||
'main.service_switch_research_mode',
|
||||
'main.service_switch_can_send_letters',
|
||||
'main.service_switch_can_send_international_sms',
|
||||
'main.archive_service',
|
||||
])
|
||||
def test_route_invalid_permissions(
|
||||
@@ -467,6 +468,7 @@ def test_route_for_platform_admin(
|
||||
'main.service_switch_live',
|
||||
'main.service_switch_research_mode',
|
||||
'main.service_switch_can_send_letters',
|
||||
'main.service_switch_can_send_international_sms',
|
||||
])
|
||||
def test_route_for_platform_admin_update_service(
|
||||
mocker,
|
||||
|
||||
Reference in New Issue
Block a user