mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Use service setting to determine prefixing of SMSs
Rather than doing this nasty `if` statement, let the API work out what to do. Also means that the logic is not repeated between the two apps.
This commit is contained in:
@@ -288,7 +288,7 @@ def get_template(
|
|||||||
return SMSPreviewTemplate(
|
return SMSPreviewTemplate(
|
||||||
template,
|
template,
|
||||||
prefix=service['name'],
|
prefix=service['name'],
|
||||||
sender=sms_sender if sms_sender else (service['sms_sender'] not in {'GOVUK', None}),
|
sender=not service['prefix_sms_with_service_name'],
|
||||||
show_recipient=show_recipient,
|
show_recipient=show_recipient,
|
||||||
redact_missing_personalisation=redact_missing_personalisation,
|
redact_missing_personalisation=redact_missing_personalisation,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ def service_json(
|
|||||||
permissions=['email', 'sms'],
|
permissions=['email', 'sms'],
|
||||||
organisation_type='central',
|
organisation_type='central',
|
||||||
free_sms_fragment_limit=250000,
|
free_sms_fragment_limit=250000,
|
||||||
|
prefix_sms_with_service_name=None,
|
||||||
):
|
):
|
||||||
if users is None:
|
if users is None:
|
||||||
users = []
|
users = []
|
||||||
@@ -63,6 +64,8 @@ def service_json(
|
|||||||
permissions = []
|
permissions = []
|
||||||
if inbound_api is None:
|
if inbound_api is None:
|
||||||
inbound_api = []
|
inbound_api = []
|
||||||
|
if prefix_sms_with_service_name is None:
|
||||||
|
prefix_sms_with_service_name = (sms_sender == 'GOVUK')
|
||||||
return {
|
return {
|
||||||
'id': id_,
|
'id': id_,
|
||||||
'name': name,
|
'name': name,
|
||||||
@@ -83,6 +86,7 @@ def service_json(
|
|||||||
'dvla_organisation': '001',
|
'dvla_organisation': '001',
|
||||||
'permissions': permissions,
|
'permissions': permissions,
|
||||||
'inbound_api': inbound_api,
|
'inbound_api': inbound_api,
|
||||||
|
'prefix_sms_with_service_name': prefix_sms_with_service_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user