mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
Merge pull request #2037 from alphagov/fix-email-branding
This PR fixes the check for the text key in the post data.
This commit is contained in:
@@ -201,7 +201,7 @@ def get_html_email_options(service):
|
||||
branding = {
|
||||
'brand_colour': service.email_branding.colour,
|
||||
'brand_logo': logo_url,
|
||||
'brand_name': service.email_branding.name,
|
||||
'brand_name': service.email_branding.text,
|
||||
}
|
||||
else:
|
||||
branding = {}
|
||||
|
||||
@@ -37,7 +37,7 @@ def create_email_branding():
|
||||
validate(data, post_create_email_branding_schema)
|
||||
|
||||
email_branding = EmailBranding(**data)
|
||||
if not data.get('text'):
|
||||
if 'text' not in data.keys():
|
||||
email_branding.text = email_branding.name
|
||||
|
||||
dao_create_email_branding(email_branding)
|
||||
@@ -51,7 +51,7 @@ def update_email_branding(email_branding_id):
|
||||
validate(data, post_update_email_branding_schema)
|
||||
|
||||
fetched_email_branding = dao_get_email_branding_by_id(email_branding_id)
|
||||
if not data.get('text') and data.get('name'):
|
||||
if 'text' not in data.keys() and 'name' in data.keys():
|
||||
data['text'] = data['name']
|
||||
dao_update_email_branding(fetched_email_branding, **data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user