mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
Sort email branding selection alphabetically
For branding combinations in service settings and branding creation/editing in platform admin.
This commit is contained in:
@@ -29,7 +29,8 @@ def email_branding():
|
|||||||
brandings = email_branding_client.get_all_email_branding()
|
brandings = email_branding_client.get_all_email_branding()
|
||||||
|
|
||||||
form = ServiceSelectEmailBranding()
|
form = ServiceSelectEmailBranding()
|
||||||
form.email_branding.choices = get_branding_as_value_and_label(brandings) + [('None', 'Create a new email branding')]
|
email_brandings = sorted(get_branding_as_value_and_label(brandings), key=lambda tup: tup[1].lower())
|
||||||
|
form.email_branding.choices = email_brandings + [('None', 'Create a new email branding')]
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
if form.email_branding.data != 'None':
|
if form.email_branding.data != 'None':
|
||||||
|
|||||||
@@ -872,7 +872,9 @@ def service_set_email_branding(service_id):
|
|||||||
form = ServiceSetBranding(branding_type=branding_type)
|
form = ServiceSetBranding(branding_type=branding_type)
|
||||||
|
|
||||||
# dynamically create org choices, including the null option
|
# dynamically create org choices, including the null option
|
||||||
form.branding_style.choices = [('None', 'None')] + get_branding_as_value_and_label(email_branding)
|
email_brandings = sorted(get_branding_as_value_and_label(email_branding),
|
||||||
|
key=lambda tup: tup[1].lower())
|
||||||
|
form.branding_style.choices = [('None', 'None')] + email_brandings
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
branding_style = None if form.branding_style.data == 'None' else form.branding_style.data
|
branding_style = None if form.branding_style.data == 'None' else form.branding_style.data
|
||||||
|
|||||||
Reference in New Issue
Block a user