Fix preview of text messages on activity page

Also beefs up the tests a bit so we can be more confident that the right
thing is getting displayed.

Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/725
This commit is contained in:
Chris Hill-Scott
2020-04-22 16:03:37 +01:00
parent f91aba212d
commit 0d92664fc8
4 changed files with 30 additions and 16 deletions

View File

@@ -16,7 +16,7 @@ from notifications_python_client.errors import HTTPError
from notifications_utils.template import (
EmailPreviewTemplate,
LetterPreviewTemplate,
SMSPreviewTemplate,
SMSBodyPreviewTemplate,
)
from app import (
@@ -421,11 +421,9 @@ def get_preview_of_content(notification):
return notification['client_reference']
if notification['template']['template_type'] == 'sms':
return str(SMSPreviewTemplate(
return str(SMSBodyPreviewTemplate(
notification['template'],
notification['personalisation'],
redact_missing_personalisation=True,
show_prefix=False,
))
if notification['template']['template_type'] == 'email':