mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-13 01:44:08 -04:00
Fix issue that happens with branding_style of None
Setting the branding_style to 'None' causes the API to remove the email_branding field from a service model. The branding request page controller was depending on that value being to present get the brand type. The email preview page (used in an iframe on various pages) wasn't able to recognise a branding_style of 'None', causing a blank page to render.
This commit is contained in:
@@ -81,9 +81,9 @@ def design_content():
|
||||
@main.route('/_email')
|
||||
def email_template():
|
||||
branding_type = 'govuk'
|
||||
branding_style = request.args.get('branding_style', None)
|
||||
branding_style = request.args.get('branding_style', 'None')
|
||||
|
||||
if branding_style:
|
||||
if branding_style != 'None':
|
||||
email_branding = email_branding_client.get_email_branding(branding_style)['email_branding']
|
||||
branding_type = email_branding['brand_type']
|
||||
|
||||
|
||||
@@ -971,11 +971,15 @@ def link_service_to_organisation(service_id):
|
||||
@user_has_permissions('manage_service')
|
||||
def branding_request(service_id):
|
||||
|
||||
email_branding = email_branding_client.get_email_branding(
|
||||
current_service.email_branding)['email_branding']
|
||||
branding_type = 'govuk'
|
||||
|
||||
if current_service.email_branding:
|
||||
email_branding = email_branding_client.get_email_branding(
|
||||
current_service.email_branding)['email_branding']
|
||||
branding_type = email_branding['brand_type']
|
||||
|
||||
form = BrandingOptionsEmail(
|
||||
options=email_branding['brand_type']
|
||||
options=branding_type
|
||||
)
|
||||
|
||||
if form.validate_on_submit():
|
||||
|
||||
Reference in New Issue
Block a user