mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Check text message sender before going live
We often check that a service has an appropriate text message sender as a condition of them going live. We don’t mention this anywhere. The services for whom GOVUK is definitely not an appropriate sender are those in local government. As we have more of these teams starting to use Notify, we should streamline the process by making this check automated. This commit adds that check, for teams who: - have text message templates - have self-declared as NHS or local government
This commit is contained in:
@@ -25,6 +25,7 @@ from flask import (
|
||||
url_for,
|
||||
)
|
||||
from flask_login import current_user
|
||||
from notifications_utils.field import Field
|
||||
from notifications_utils.formatters import make_quotes_smart
|
||||
from notifications_utils.recipients import RecipientCSV
|
||||
from notifications_utils.take import Take
|
||||
@@ -663,3 +664,10 @@ def should_skip_template_page(template_type):
|
||||
not current_user.has_permissions('manage_templates', 'manage_api_keys') and
|
||||
template_type != 'letter'
|
||||
)
|
||||
|
||||
|
||||
def get_default_sms_sender(sms_senders):
|
||||
return str(next((
|
||||
Field(x['sms_sender'], html='escape')
|
||||
for x in sms_senders if x['is_default']
|
||||
), "None"))
|
||||
|
||||
Reference in New Issue
Block a user