mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 17:45:41 -04:00
Give GP practices NHS branding by default
Previously we were doing it based on their email address. This will also apply it if they self-select as a GP surgery, even if they don’t have an NHS email address.
This commit is contained in:
@@ -42,6 +42,7 @@ from app.models import (
|
|||||||
EMAIL_TYPE,
|
EMAIL_TYPE,
|
||||||
INTERNATIONAL_SMS_TYPE,
|
INTERNATIONAL_SMS_TYPE,
|
||||||
KEY_TYPE_TEST,
|
KEY_TYPE_TEST,
|
||||||
|
NHS_ORGANISATION_TYPES,
|
||||||
NON_CROWN_ORGANISATION_TYPES,
|
NON_CROWN_ORGANISATION_TYPES,
|
||||||
SMS_TYPE,
|
SMS_TYPE,
|
||||||
LETTER_TYPE,
|
LETTER_TYPE,
|
||||||
@@ -306,7 +307,7 @@ def dao_create_service(
|
|||||||
if organisation.letter_branding and not service.letter_branding:
|
if organisation.letter_branding and not service.letter_branding:
|
||||||
service.letter_branding = organisation.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.email_branding = dao_get_email_branding_by_name('NHS')
|
||||||
service.letter_branding = dao_get_letter_branding_by_name('NHS')
|
service.letter_branding = dao_get_letter_branding_by_name('NHS')
|
||||||
if organisation:
|
if organisation:
|
||||||
|
|||||||
@@ -331,6 +331,7 @@ ORGANISATION_TYPES = [
|
|||||||
|
|
||||||
CROWN_ORGANISATION_TYPES = ["nhs_central"]
|
CROWN_ORGANISATION_TYPES = ["nhs_central"]
|
||||||
NON_CROWN_ORGANISATION_TYPES = ["local", "nhs_local", "nhs_gp", "emergency_service", "school_or_college"]
|
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):
|
class OrganisationTypes(db.Model):
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ def test_create_service_with_organisation(notify_db_session):
|
|||||||
|
|
||||||
@pytest.mark.parametrize('email_address, organisation_type', (
|
@pytest.mark.parametrize('email_address, organisation_type', (
|
||||||
("test@example.gov.uk", 'nhs_central'),
|
("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", 'nhs_local'),
|
||||||
("test@nhs.net", 'local'),
|
("test@nhs.net", 'local'),
|
||||||
("test@nhs.net", 'central'),
|
("test@nhs.net", 'central'),
|
||||||
|
|||||||
Reference in New Issue
Block a user