Move end of tour route into tour.py

In https://github.com/alphagov/notifications-admin/pull/3663/files we
made specific routes for sending the ‘tour’ text message, rather than
sharing the ‘one-off’ routes in `send.py`.

This commit moves the final route in the tour journey into `tour.py` as
well, which is where I expected to find it when I was looking for it
just now.
This commit is contained in:
Chris Hill-Scott
2021-10-06 12:32:00 +01:00
parent 1c68e4bb43
commit 1cc087b8de
4 changed files with 52 additions and 52 deletions

View File

@@ -815,17 +815,6 @@ def start_job(service_id, upload_id):
)
@main.route("/services/<uuid:service_id>/end-tour/<uuid:example_template_id>")
@user_has_permissions('manage_templates')
def go_to_dashboard_after_tour(service_id, example_template_id):
service_api_client.delete_service_template(service_id, example_template_id)
return redirect(
url_for('main.service_dashboard', service_id=service_id)
)
def fields_to_fill_in(template, prefill_current_user=False):
if 'letter' == template.template_type:

View File

@@ -1,6 +1,6 @@
from flask import abort, redirect, render_template, session
from app import current_service, current_user, url_for
from app import current_service, current_user, service_api_client, url_for
from app.main import main
from app.main.views.send import (
all_placeholders_in_session,
@@ -149,3 +149,14 @@ def check_tour_notification(service_id, template_id):
back_link=back_link,
help='2',
)
@main.route("/services/<uuid:service_id>/end-tour/<uuid:example_template_id>")
@user_has_permissions('manage_templates')
def go_to_dashboard_after_tour(service_id, example_template_id):
service_api_client.delete_service_template(service_id, example_template_id)
return redirect(
url_for('main.service_dashboard', service_id=service_id)
)