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:
Chris Hill-Scott
2018-08-23 09:14:01 +01:00
parent 1e28fe4ffd
commit 9b9acfa291
4 changed files with 22 additions and 42 deletions

View File

@@ -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,
)