mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 11:23:48 -05:00
Refactor setting value on letter branding form
WTForms lets you pre-populate a form’s value by passing it in as an argument to the constructor. This will be good for us because it will let us access that value in the constructor later on.
This commit is contained in:
@@ -876,7 +876,10 @@ def service_preview_email_branding(service_id):
|
||||
@user_is_platform_admin
|
||||
def set_letter_branding(service_id):
|
||||
|
||||
form = LetterBranding(choices=email_branding_client.get_letter_email_branding().items())
|
||||
form = LetterBranding(
|
||||
choices=email_branding_client.get_letter_email_branding().items(),
|
||||
dvla_org_id=current_service.dvla_organisation,
|
||||
)
|
||||
|
||||
if form.validate_on_submit():
|
||||
service_api_client.update_service(
|
||||
@@ -885,8 +888,6 @@ def set_letter_branding(service_id):
|
||||
)
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
form.dvla_org_id.data = current_service.dvla_organisation
|
||||
|
||||
return render_template(
|
||||
'views/service-settings/set-letter-branding.html',
|
||||
form=form,
|
||||
|
||||
Reference in New Issue
Block a user