From 7e8471f21f0c353247c20c707b1eab1ebe162d82 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 14 Jun 2017 17:44:50 +0100 Subject: [PATCH] Look at `body`, not `template` in outbound texts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As of this PR we don’t return the template content any more: https://github.com/alphagov/notifications-api/pull/1015 --- app/main/views/conversation.py | 2 +- tests/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main/views/conversation.py b/app/main/views/conversation.py index 78e3ee632..5542e25de 100644 --- a/app/main/views/conversation.py +++ b/app/main/views/conversation.py @@ -46,7 +46,7 @@ def get_sms_thread(service_id, user_number): 'inbound': is_inbound, 'content': SMSPreviewTemplate( { - 'content': notification.get('content') or notification['template']['content'] + 'content': notification.get('content') or notification['body'] }, downgrade_non_gsm_characters=(not is_inbound) ), diff --git a/tests/__init__.py b/tests/__init__.py index 3b8ff9a8c..8560ead2d 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -249,8 +249,8 @@ def notification_json( 'id': template['id'], 'name': template['name'], 'template_type': template['template_type'], - 'content': template['content'], }, + 'body': template['content'], 'job': job_payload, 'sent_at': sent_at, 'status': status,