make sure inbound sms page doesn't break if you receive a blank inbound message

This commit is contained in:
Leo Hemsted
2017-09-27 17:38:42 +01:00
parent f9390b4fc5
commit b1e809e82a
2 changed files with 38 additions and 9 deletions

View File

@@ -73,7 +73,10 @@ def get_sms_thread(service_id, user_number):
'inbound': is_inbound,
'content': SMSPreviewTemplate(
{
'content': notification.get('content') or notification['template']['content']
'content': (
notification['content'] if is_inbound else
notification['template']['content']
)
},
notification.get('personalisation'),
downgrade_non_gsm_characters=(not is_inbound),