Now that EmailBranding includes the brand type we do not need two separate colours. This PR removes the new colour columns.

This commit is contained in:
Rebecca Law
2018-08-24 13:51:11 +01:00
parent 44818a91e7
commit 562facb49c
5 changed files with 10 additions and 64 deletions

View File

@@ -30,8 +30,7 @@ from app.models import (
NOTIFICATION_CREATED,
NOTIFICATION_TECHNICAL_FAILURE,
NOTIFICATION_SENT,
NOTIFICATION_SENDING,
BRANDING_BOTH
NOTIFICATION_SENDING
)
@@ -199,10 +198,8 @@ def get_html_email_options(service):
service.email_branding.logo
) if service.email_branding.logo else None
colour = _set_colour(service)
branding = {
'brand_colour': colour,
'brand_colour': service.email_branding.colour,
'brand_logo': logo_url,
'brand_name': service.email_branding.text,
}
@@ -212,15 +209,6 @@ def get_html_email_options(service):
return dict(govuk_banner=govuk_banner, brand_banner=brand_banner, **branding)
def _set_colour(service):
if service.branding in [BRANDING_BOTH, BRANDING_ORG]:
return service.email_branding.single_id_colour or service.email_branding.colour
elif service.branding == BRANDING_ORG_BANNER:
return service.email_branding.banner_colour or service.email_branding.colour
elif service.branding == BRANDING_GOVUK:
return None
def technical_failure(notification):
notification.status = NOTIFICATION_TECHNICAL_FAILURE
dao_update_notification(notification)