Pre-populate rename folder form with current name

Often people will be editing the existing name, not changing it
completely.

This matches what we do when someone wants to rename their template or
service.
This commit is contained in:
Chris Hill-Scott
2018-11-13 16:05:05 +00:00
parent ce798a02e4
commit 666381e23d
3 changed files with 25 additions and 2 deletions

View File

@@ -374,7 +374,10 @@ def manage_template_folder(service_id, template_folder_id):
if not current_service.has_permission('edit_folders'):
abort(403)
form = TemplateFolderForm()
form = TemplateFolderForm(
name=current_service.get_template_folder(template_folder_id)['name']
)
if form.validate_on_submit():
template_folder_api_client.update_template_folder(
current_service.id, template_folder_id, name=form.name.data