diff --git a/app/main/views/notifications.py b/app/main/views/notifications.py index e29f06ce0..20d309a21 100644 --- a/app/main/views/notifications.py +++ b/app/main/views/notifications.py @@ -57,7 +57,7 @@ def view_notification(service_id, notification_id): ), show_recipient=True, ) - template.values = get_all_personalisation_from_notification(notification) + template.values = notification['personalisation'] if notification['job']: job = job_api_client.get_job(service_id, notification['job']['id'])['data'] else: @@ -106,18 +106,3 @@ def get_single_notification_partials(notification): notification=notification ), } - - -def get_all_personalisation_from_notification(notification): - if notification['template']['template_type'] == 'email': - return dict( - email_address=notification['to'], - **notification['personalisation'] - ) - if notification['template']['template_type'] == 'sms': - return dict( - phone_number=notification['to'], - **notification['personalisation'] - ) - if notification['template']['template_type'] == 'letter': - return notification['personalisation'] diff --git a/tests/app/main/views/test_notifications.py b/tests/app/main/views/test_notifications.py index 5c36bb6f8..10cfa2485 100644 --- a/tests/app/main/views/test_notifications.py +++ b/tests/app/main/views/test_notifications.py @@ -43,9 +43,6 @@ def test_notification_status_page_shows_details( notification_id=fake_uuid ) - assert normalize_spaces(page.select('.sms-message-recipient')[0].text) == ( - 'To: 07123456789' - ) assert normalize_spaces(page.select('.sms-message-wrapper')[0].text) == ( 'service one: hello Jo' )