mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
dont let people get into one-off flow for deleted templates
previously we'd skip the template page entirely if someone didnt have manage templates/api keys permission. however, if the template is deleted you'd then go through the flow entering placeholders and stuff before it would then crash when trying to send. instead, just bounce the user to the template page. It has the content and says when the template was deleted.
This commit is contained in:
@@ -874,7 +874,7 @@ def get_send_test_page_title(template_type, entering_recipient, name=None):
|
||||
|
||||
def get_back_link(service_id, template, step_index, placeholders=None):
|
||||
if step_index == 0:
|
||||
if should_skip_template_page(template.template_type):
|
||||
if should_skip_template_page(template._template):
|
||||
return url_for(
|
||||
'.choose_template',
|
||||
service_id=service_id,
|
||||
|
||||
@@ -58,8 +58,7 @@ def view_template(service_id, template_id):
|
||||
template_folder = current_service.get_template_folder(template['folder'])
|
||||
|
||||
user_has_template_permission = current_user.has_template_folder_permission(template_folder)
|
||||
|
||||
if should_skip_template_page(template['template_type']):
|
||||
if should_skip_template_page(template):
|
||||
return redirect(url_for(
|
||||
'.set_sender', service_id=service_id, template_id=template_id
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user