diff --git a/app/formatters.py b/app/formatters.py index 91ecdbb5c..de413e7ac 100644 --- a/app/formatters.py +++ b/app/formatters.py @@ -220,7 +220,7 @@ def format_notification_status(status, template_type): 'failed': '', 'technical-failure': 'Technical failure', 'temporary-failure': '', - 'permanent-failure': '', + 'permanent-failure': 'Permanent failure', 'delivered': '', 'received': '', 'accepted': '', diff --git a/app/templates/views/message-status.html b/app/templates/views/message-status.html index b1e1bc2fd..3ba7f8c9d 100644 --- a/app/templates/views/message-status.html +++ b/app/templates/views/message-status.html @@ -80,6 +80,7 @@ ('Printed', 'The provider has printed the letter. Letters are printed at 5:30pm and dispatched the next working day.'), ('Cancelled', 'Sending cancelled. Your letter will not be printed or dispatched.'), ('Technical failure', 'Notify had an unexpected error while sending the letter to our printing provider.'), + ('Permanent failure', 'The provider cannot print the letter. Your letter will not be dispatched.') ] %} {% call row() %} {{ text_field(message_length) }} diff --git a/app/templates/views/notifications/notification.html b/app/templates/views/notifications/notification.html index 808f21a86..07924bede 100644 --- a/app/templates/views/notifications/notification.html +++ b/app/templates/views/notifications/notification.html @@ -41,7 +41,7 @@

{% if template.template_type == 'letter' %} - {% if notification_status in ('permanent-failure', 'cancelled') %} + {% if notification_status == 'cancelled' %}

Cancelled {{ updated_at|format_datetime_short }}

@@ -49,6 +49,10 @@

{{ message.summary | safe }}

+ {% elif notification_status == 'permanent-failure' %} +

+ Permanent failure – The provider cannot print the letter. Your letter will not be dispatched. +

{% elif notification_status == 'technical-failure' %}

Technical failure – Notify will resend once the team have diff --git a/tests/app/main/views/test_activity.py b/tests/app/main/views/test_activity.py index 1b793f771..b44741051 100644 --- a/tests/app/main/views/test_activity.py +++ b/tests/app/main/views/test_activity.py @@ -741,7 +741,7 @@ def test_big_numbers_dont_show_for_letters( ('letter', 'received', '27 September at 5:30pm', True), ('letter', 'accepted', '27 September at 5:30pm', True), ('letter', 'cancelled', '27 September at 5:30pm', False), # The API won’t return cancelled letters - ('letter', 'permanent-failure', '27 September at 5:31pm', False), # Deprecated for ‘cancelled’ + ('letter', 'permanent-failure', 'Permanent failure 27 September at 5:31pm', False), ('letter', 'temporary-failure', '27 September at 5:30pm', False), # Not currently a real letter status ('letter', 'virus-scan-failed', 'Virus detected 27 September at 5:30pm', False), ('letter', 'validation-failed', 'Validation failed 27 September at 5:30pm', False), diff --git a/tests/app/main/views/test_notifications.py b/tests/app/main/views/test_notifications.py index 093b7849c..dd74d1723 100644 --- a/tests/app/main/views/test_notifications.py +++ b/tests/app/main/views/test_notifications.py @@ -442,7 +442,7 @@ def test_notification_page_shows_validation_failed_precompiled_letter( @pytest.mark.parametrize('notification_status, expected_message', ( ( 'permanent-failure', - 'Cancelled 1 January at 1:02am', + 'Permanent failure – The provider cannot print the letter. Your letter will not be dispatched.', ), ( 'cancelled',