mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Don’t hide the rename form on delete
It’s weird that this page changes when you click delete – it looks like you’re going to a different page. It should feel like you’re on the same page, just with the confirmation message. The problem we had before is that the rename form would `POST` to `…/delete`, which would then delete the template instead of updating its name. We can fix this by explicitly setting the `action` attribute on the rename form to always post to `…/manage`, even if the user is currently looking at the `…/delete` page.
This commit is contained in:
@@ -406,7 +406,9 @@ def manage_template_folder(service_id, template_folder_id):
|
||||
def delete_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']
|
||||
)
|
||||
template_folder_path = current_service.get_template_folder_path(template_folder_id)
|
||||
template_folder_name = template_folder_path[-1]["name"]
|
||||
|
||||
@@ -450,7 +452,6 @@ def delete_template_folder(service_id, template_folder_id):
|
||||
current_service_id=current_service.id,
|
||||
template_folder_id=template_folder_id,
|
||||
template_type="all",
|
||||
delete_folder=True
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user