Skip to content

Commit

Permalink
New service doesn't inherit org branding (#2147)
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbahrai authored Mar 25, 2024
1 parent b51e4aa commit 63fd7d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions app/dao/services_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ def dao_create_service(
if organisation:
service.organisation_id = organisation.id
service.organisation_type = organisation.organisation_type
if organisation.email_branding:
service.email_branding = organisation.email_branding

if organisation.letter_branding and not service.letter_branding:
service.letter_branding = organisation.letter_branding
Expand Down
5 changes: 2 additions & 3 deletions tests/app/service/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def test_create_service_with_domain_sets_organisation(admin_request, sample_user
assert json_resp["data"]["organisation"] is None


def test_create_service_inherits_branding_from_organisation(admin_request, sample_user, mocker):
def test_create_service_doesnt_inherit_branding_from_organisation(admin_request, sample_user, mocker):
org = create_organisation()
email_branding = create_email_branding()
org.email_branding = email_branding
Expand All @@ -482,8 +482,7 @@ def test_create_service_inherits_branding_from_organisation(admin_request, sampl
_expected_status=201,
)

assert json_resp["data"]["email_branding"] == str(email_branding.id)
assert json_resp["data"]["letter_branding"] == str(letter_branding.id)
assert json_resp["data"]["email_branding"] is None


def test_should_not_create_service_with_missing_user_id_field(notify_api, fake_uuid):
Expand Down

0 comments on commit 63fd7d0

Please sign in to comment.