mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 02:23:19 -04:00
Pass current value to form constructor
This is the more idiomatic way to achieve this in WTForms.
This commit is contained in:
@@ -323,10 +323,7 @@ def organisation_settings(org_id):
|
|||||||
@main.route("/organisations/<uuid:org_id>/settings/edit-name", methods=['GET', 'POST'])
|
@main.route("/organisations/<uuid:org_id>/settings/edit-name", methods=['GET', 'POST'])
|
||||||
@user_is_platform_admin
|
@user_is_platform_admin
|
||||||
def edit_organisation_name(org_id):
|
def edit_organisation_name(org_id):
|
||||||
form = RenameOrganisationForm()
|
form = RenameOrganisationForm(name=current_organisation.name)
|
||||||
|
|
||||||
if request.method == 'GET':
|
|
||||||
form.name.data = current_organisation.name
|
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user