mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 02:23:19 -04:00
rename branding to email_branding
to help transition to having letter branding as well
This commit is contained in:
+5
-5
@@ -782,7 +782,7 @@ class RadioFieldWithRequiredMessage(RadioField):
|
|||||||
raise ValueError(self.required_message)
|
raise ValueError(self.required_message)
|
||||||
|
|
||||||
|
|
||||||
class ServiceSetBranding(StripWhitespaceForm):
|
class ServiceSetEmailBranding(StripWhitespaceForm):
|
||||||
|
|
||||||
branding_style = RadioFieldWithNoneOption(
|
branding_style = RadioFieldWithNoneOption(
|
||||||
'Branding style',
|
'Branding style',
|
||||||
@@ -793,14 +793,14 @@ class ServiceSetBranding(StripWhitespaceForm):
|
|||||||
|
|
||||||
DEFAULT = (FieldWithNoneOption.NONE_OPTION_VALUE, 'GOV.UK')
|
DEFAULT = (FieldWithNoneOption.NONE_OPTION_VALUE, 'GOV.UK')
|
||||||
|
|
||||||
def __init__(self, all_email_brandings, current_email_branding):
|
def __init__(self, all_branding_options, current_branding):
|
||||||
|
|
||||||
super().__init__(branding_style=current_email_branding)
|
super().__init__(branding_style=current_branding)
|
||||||
|
|
||||||
self.branding_style.choices = sorted(
|
self.branding_style.choices = sorted(
|
||||||
all_email_brandings + [self.DEFAULT],
|
all_branding_options + [self.DEFAULT],
|
||||||
key=lambda branding: (
|
key=lambda branding: (
|
||||||
branding[0] != current_email_branding,
|
branding[0] != current_branding,
|
||||||
branding[0] is not self.DEFAULT[0],
|
branding[0] is not self.DEFAULT[0],
|
||||||
branding[1].lower(),
|
branding[1].lower(),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ from app.main.forms import (
|
|||||||
ServiceLetterContactBlockForm,
|
ServiceLetterContactBlockForm,
|
||||||
ServicePreviewBranding,
|
ServicePreviewBranding,
|
||||||
ServiceReplyToEmailForm,
|
ServiceReplyToEmailForm,
|
||||||
ServiceSetBranding,
|
ServiceSetEmailBranding,
|
||||||
ServiceSmsSenderForm,
|
ServiceSmsSenderForm,
|
||||||
ServiceSwitchChannelForm,
|
ServiceSwitchChannelForm,
|
||||||
SMSPrefixForm,
|
SMSPrefixForm,
|
||||||
@@ -759,9 +759,9 @@ def set_free_sms_allowance(service_id):
|
|||||||
def service_set_email_branding(service_id):
|
def service_set_email_branding(service_id):
|
||||||
email_branding = email_branding_client.get_all_email_branding()
|
email_branding = email_branding_client.get_all_email_branding()
|
||||||
|
|
||||||
form = ServiceSetBranding(
|
form = ServiceSetEmailBranding(
|
||||||
all_email_brandings=get_branding_as_value_and_label(email_branding),
|
all_branding_options=get_branding_as_value_and_label(email_branding),
|
||||||
current_email_branding=current_service.email_branding_id,
|
current_branding=current_service.email_branding_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
|
|||||||
Reference in New Issue
Block a user