From 2ba8ff479ccaa8258f679d8f425c52a1e7c39ea3 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 14 Mar 2017 13:39:21 +0000 Subject: [PATCH] Redirect to individual template page after adding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When you add a new template the next thing you want to do is probably: - send a test - edit it after seeing what it looks like So let’s redirect you straight to the page where you can do these things. This is especially important for letters where we want to tighten the edit/feedback loop. --- app/main/views/templates.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 8edf9482b..065130e6d 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -202,7 +202,7 @@ def add_service_template(service_id, template_type): if form.process_type.data == 'priority': abort_403_if_not_admin_user() try: - service_api_client.create_service_template( + new_template = service_api_client.create_service_template( form.name.data, template_type, form.template_content.data, @@ -221,7 +221,7 @@ def add_service_template(service_id, template_type): raise e else: return redirect( - url_for('.choose_template', service_id=service_id) + url_for('.view_template', service_id=service_id, template_id=new_template['data']['id']) ) return render_template(