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

@@ -1,3 +1,4 @@
from flask import abort
from notifications_utils.field import Field
from werkzeug.utils import cached_property
@@ -307,6 +308,15 @@ class Service():
)
]
def get_template_folder(self, folder_id):
try:
return next(
folder for folder in self.all_template_folders
if folder['id'] == folder_id
)
except StopIteration:
abort(404)
def is_folder_visible(self, template_folder_id, template_type='all'):
if template_type == 'all':