mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-14 23:08:07 -04:00
Move and clarify "NHS_BRANDING_ID" constant
This is specific to email branding [^1]. Using the name to match
the current branding is more error-prone.
[^1]: a165f62b60
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
from app.models.organisation import Organisation
|
||||
|
||||
NHS_TYPES = dict(Organisation.NHS_TYPES).keys()
|
||||
NHS_EMAIL_BRANDING_ID = 'a7dc4e56-660b-4db7-8cff-12c37b12b5ea'
|
||||
|
||||
|
||||
def get_email_choices(service):
|
||||
organisation_branding_id = service.organisation.email_branding_id if service.organisation else None
|
||||
service_branding_id = service.email_branding_id
|
||||
service_branding_name = service.email_branding_name
|
||||
|
||||
if (
|
||||
service.organisation_type == Organisation.TYPE_CENTRAL
|
||||
@@ -19,13 +19,13 @@ def get_email_choices(service):
|
||||
service.organisation_type == Organisation.TYPE_CENTRAL
|
||||
and service.organisation
|
||||
and organisation_branding_id is None
|
||||
and service_branding_name.lower() != 'GOV.UK and {}'.format(service.organisation.name).lower()
|
||||
and service.email_branding_name.lower() != 'GOV.UK and {}'.format(service.organisation.name).lower()
|
||||
):
|
||||
yield ('govuk_and_org', 'GOV.UK and {}'.format(service.organisation.name))
|
||||
|
||||
if (
|
||||
service.organisation_type in NHS_TYPES
|
||||
and service_branding_name != 'NHS'
|
||||
and service_branding_id != NHS_EMAIL_BRANDING_ID
|
||||
):
|
||||
yield ('nhs', 'NHS')
|
||||
|
||||
@@ -43,11 +43,10 @@ def get_email_choices(service):
|
||||
def get_letter_choices(service):
|
||||
organisation_branding_id = service.organisation.letter_branding_id if service.organisation else None
|
||||
service_branding_id = service.letter_branding_id
|
||||
service_branding_name = service.letter_branding_name
|
||||
|
||||
if (
|
||||
service.organisation_type in NHS_TYPES
|
||||
and service_branding_name != 'NHS'
|
||||
and service.letter_branding_name != 'NHS'
|
||||
):
|
||||
yield ('nhs', 'NHS')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user