diff --git a/app/dao/services_dao.py b/app/dao/services_dao.py index 988908616..666034ad1 100644 --- a/app/dao/services_dao.py +++ b/app/dao/services_dao.py @@ -42,6 +42,7 @@ from app.models import ( EMAIL_TYPE, INTERNATIONAL_SMS_TYPE, KEY_TYPE_TEST, + NHS_ORGANISATION_TYPES, NON_CROWN_ORGANISATION_TYPES, SMS_TYPE, LETTER_TYPE, @@ -306,7 +307,7 @@ def dao_create_service( if organisation.letter_branding and not service.letter_branding: service.letter_branding = organisation.letter_branding - elif service.organisation_type in ['nhs_central', 'nhs_local'] or email_address_is_nhs(user.email_address): + elif service.organisation_type in NHS_ORGANISATION_TYPES or email_address_is_nhs(user.email_address): service.email_branding = dao_get_email_branding_by_name('NHS') service.letter_branding = dao_get_letter_branding_by_name('NHS') if organisation: diff --git a/app/models.py b/app/models.py index 20c4ba5af..60d683980 100644 --- a/app/models.py +++ b/app/models.py @@ -331,6 +331,7 @@ ORGANISATION_TYPES = [ CROWN_ORGANISATION_TYPES = ["nhs_central"] NON_CROWN_ORGANISATION_TYPES = ["local", "nhs_local", "nhs_gp", "emergency_service", "school_or_college"] +NHS_ORGANISATION_TYPES = ["nhs_central", "nhs_local", "nhs_gp"] class OrganisationTypes(db.Model): diff --git a/tests/app/dao/test_services_dao.py b/tests/app/dao/test_services_dao.py index 1a64c85af..74505f18d 100644 --- a/tests/app/dao/test_services_dao.py +++ b/tests/app/dao/test_services_dao.py @@ -143,6 +143,8 @@ def test_create_service_with_organisation(notify_db_session): @pytest.mark.parametrize('email_address, organisation_type', ( ("test@example.gov.uk", 'nhs_central'), + ("test@example.gov.uk", 'nhs_local'), + ("test@example.gov.uk", 'nhs_gp'), ("test@nhs.net", 'nhs_local'), ("test@nhs.net", 'local'), ("test@nhs.net", 'central'),