mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user