mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Merge pull request #1334 from alphagov/fix-missing-recipient-on-notification-page
Fix missing recipients on notification page
This commit is contained in:
@@ -57,7 +57,7 @@ def view_notification(service_id, notification_id):
|
|||||||
),
|
),
|
||||||
show_recipient=True,
|
show_recipient=True,
|
||||||
)
|
)
|
||||||
template.values = notification['personalisation']
|
template.values = get_all_personalisation_from_notification(notification)
|
||||||
if notification['job']:
|
if notification['job']:
|
||||||
job = job_api_client.get_job(service_id, notification['job']['id'])['data']
|
job = job_api_client.get_job(service_id, notification['job']['id'])['data']
|
||||||
else:
|
else:
|
||||||
@@ -106,3 +106,18 @@ def get_single_notification_partials(notification):
|
|||||||
notification=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']
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ def test_notification_status_page_shows_details(
|
|||||||
notification_id=fake_uuid
|
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) == (
|
assert normalize_spaces(page.select('.sms-message-wrapper')[0].text) == (
|
||||||
'service one: hello Jo'
|
'service one: hello Jo'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user