Redirect to individual template page after adding

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.
This commit is contained in:
Chris Hill-Scott
2017-03-14 13:39:21 +00:00
parent 89d3a116b9
commit 2ba8ff479c

View File

@@ -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(