diff --git a/app/main/views/send.py b/app/main/views/send.py index 7899af5a8..56956db0b 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -802,9 +802,15 @@ def get_skip_link(step_index, template): ) @user_has_permissions("send_messages", restrict_admin_usage=True) def send_one_off_to_myself(service_id, template_id): - db_template = current_service.get_template_with_user_permission_or_403( - template_id, current_user - ) + current_app.logger.info("Send one off to myself") + try: + db_template = current_service.get_template_with_user_permission_or_403( + template_id, current_user + ) + except Exception: + current_app.logger.exception("Couldnt get template for one off") + # Use 406 just because we're limited to certain codes here and it will point us back to a problem here + abort(406) if db_template["template_type"] not in ("sms", "email"): abort(404) diff --git a/app/templates/components/components/back-link/template.njk b/app/templates/components/components/back-link/template.njk index 25e611b06..aba4e4d95 100644 --- a/app/templates/components/components/back-link/template.njk +++ b/app/templates/components/components/back-link/template.njk @@ -1,2 +1,4 @@ -{{ (params.html | safe if params.html else (params.text if params.text else 'Back')) }} + diff --git a/app/templates/components/main_nav.html b/app/templates/components/main_nav.html index 597ccf45b..118442095 100644 --- a/app/templates/components/main_nav.html +++ b/app/templates/components/main_nav.html @@ -1,7 +1,7 @@ {% if help %} {% include 'partials/tour.html' %} {% else %} -