mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Select a branding with a link, not form
Selecting a branding just takes you to a new page, it doesn’t change any state. Links are generally the way you go from one page to another on the web.
This commit is contained in:
@@ -713,20 +713,6 @@ class ServicePreviewBranding(StripWhitespaceForm):
|
||||
branding_style = HiddenField('branding_style')
|
||||
|
||||
|
||||
class ServiceSelectEmailBranding(StripWhitespaceForm):
|
||||
|
||||
def __init__(self, email_brandings=[], *args, **kwargs):
|
||||
self.email_branding.choices = email_brandings
|
||||
super(ServiceSelectEmailBranding, self).__init__(*args, **kwargs)
|
||||
|
||||
email_branding = RadioField(
|
||||
'Email branding',
|
||||
validators=[
|
||||
DataRequired()
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
class ServiceUpdateEmailBranding(StripWhitespaceForm):
|
||||
|
||||
name = StringField('Name of brand')
|
||||
|
||||
@@ -3,11 +3,7 @@ from flask_login import login_required
|
||||
|
||||
from app import email_branding_client
|
||||
from app.main import main
|
||||
from app.main.forms import (
|
||||
SearchTemplatesForm,
|
||||
ServiceSelectEmailBranding,
|
||||
ServiceUpdateEmailBranding,
|
||||
)
|
||||
from app.main.forms import SearchTemplatesForm, ServiceUpdateEmailBranding
|
||||
from app.main.s3_client import (
|
||||
TEMP_TAG,
|
||||
delete_temp_file,
|
||||
@@ -25,16 +21,9 @@ from app.utils import get_cdn_domain, user_is_platform_admin
|
||||
def email_branding():
|
||||
brandings = email_branding_client.get_all_email_branding(sort_key='name')
|
||||
|
||||
form = ServiceSelectEmailBranding()
|
||||
email_brandings = get_branding_as_value_and_label(brandings)
|
||||
form.email_branding.choices = email_brandings
|
||||
|
||||
if form.validate_on_submit():
|
||||
return redirect(url_for('.update_email_branding', branding_id=form.email_branding.data))
|
||||
|
||||
return render_template(
|
||||
'views/email-branding/select-branding.html',
|
||||
form=form,
|
||||
email_brandings=get_branding_as_value_and_label(brandings),
|
||||
search_form=SearchTemplatesForm(),
|
||||
show_search_box=len(brandings) > 9,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user