Only link to message status if message has failed

This retores the behaviour to as it was before
https://github.com/alphagov/notifications-admin/pull/2962
which inadvertently started linking to the guidance for messages that
were delivered or in sending.
This commit is contained in:
Chris Hill-Scott
2019-05-13 13:25:39 +01:00
parent 1d7ce85443
commit 3c6598cbc2
4 changed files with 47 additions and 7 deletions

View File

@@ -442,9 +442,14 @@ def format_notification_status_as_field_status(status, notification_type):
).get(status, 'error')
def format_notification_status_as_url(notification_type):
def format_notification_status_as_url(status, notification_type):
url = partial(url_for, "main.message_status")
if status not in {
'technical-failure', 'temporary-failure', 'permanent-failure',
}:
return None
return {
'email': url(_anchor='email-statuses'),
'sms': url(_anchor='sms-statuses')