Fixed viewing templates.

This commit is contained in:
Nicholas Staples
2016-01-22 11:20:39 +00:00
parent bb853ee95a
commit ac433835f0
3 changed files with 6 additions and 7 deletions

View File

@@ -14,7 +14,6 @@ from client.errors import HTTPError
def manage_service_templates(service_id):
try:
templates = tdao.get_service_templates(service_id)['data']
print(templates)
except HTTPError as e:
if e.status_code == 404:
abort(404)

View File

@@ -57,7 +57,7 @@
</summary>
<div>
<a href="#">Switch to A N Other service</a>
<a href="{{ url_for('.add_service') }}">Add a new service to GOV.UK Notify</a>
<a href="{{ url_for('main.add_service') }}">Add a new service to GOV.UK Notify</a>
</div>
</details>
</div>

View File

@@ -20,15 +20,15 @@ GOV.UK Notify | Manage templates
{% for template in templates %}
{% if template.get_field('template_type') == 'sms' %}
{{ sms_message(
template.content,
name=template.name,
template.get_field('content'),
name=template.title,
edit_link=url_for('.edit_service_template', service_id=template.get_field('service'), template_id=template.get_field('id'))
) }}
{% elif template.get_field('template_type') == 'email' %}
{{ email_message(
"template subject",
template.content,
name=template.name,
template.get_field('subject'),
template.get_field('content'),
name=template.get_field('name'),
edit_link=url_for('.edit_service_template', service_id=template.get_field('service'), template_id=template.get_field('id'))
) }}
{% endif %}