mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 11:49:49 -04:00
Allow updates to SMS prefixing setting
We’re extracting this from being determined based on what the sender name is to its own setting. This commit will let users set it independently. Until the explicitly set it, it will still be determined based on whether their default sender name matches the default for the platform.
This commit is contained in:
@@ -38,6 +38,7 @@ from app.main.forms import (
|
||||
OrganisationTypeForm,
|
||||
FreeSMSAllowance,
|
||||
ServiceEditInboundNumberForm,
|
||||
SMSPrefixForm,
|
||||
)
|
||||
from app import user_api_client, current_service, organisations_client, inbound_number_client
|
||||
from notifications_utils.formatters import formatted_list
|
||||
@@ -103,7 +104,8 @@ def service_settings(service_id):
|
||||
default_letter_contact_block=default_letter_contact_block,
|
||||
letter_contact_details_count=letter_contact_details_count,
|
||||
default_sms_sender=default_sms_sender,
|
||||
sms_sender_count=sms_sender_count
|
||||
sms_sender_count=sms_sender_count,
|
||||
prefix_sms_with_service_name=current_service['prefix_sms_with_service_name'],
|
||||
)
|
||||
|
||||
|
||||
@@ -486,6 +488,28 @@ def service_set_sms(service_id):
|
||||
)
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/sms-prefix", methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@user_has_permissions('manage_settings', admin_override=True)
|
||||
def service_set_sms_prefix(service_id):
|
||||
|
||||
form = SMSPrefixForm(enabled=(
|
||||
'on' if current_service['prefix_sms_with_service_name'] else 'off'
|
||||
))
|
||||
|
||||
if form.validate_on_submit():
|
||||
service_api_client.update_service(
|
||||
current_service['id'],
|
||||
prefix_sms_with_service_name=(form.enabled.data == 'on')
|
||||
)
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
return render_template(
|
||||
'views/service-settings/sms-prefix.html',
|
||||
form=form
|
||||
)
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/service-settings/set-international-sms", methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@user_has_permissions('manage_settings', admin_override=True)
|
||||
|
||||
Reference in New Issue
Block a user