From 498092f9aca68e65c177b03bd12592abb98e628d Mon Sep 17 00:00:00 2001
From: Rebecca Law
Date: Thu, 10 Jun 2021 08:56:14 +0100
Subject: [PATCH] When a letters has passed our validation but is not the
postal provider is unable to print the letter we need to mark the letter as
failed. If we mark the letter as a technical-failure, we say that we will fix
the issue, which is wrong because we can not fix the issue. If we mark the
letter as validation-failed, the letter is in wrong bucket so the letter is
not viewable/downloadable by the client.
This PR updates the message for a letter marked as permanent-failure to
better reflect what has actually happened.
---
app/templates/views/notifications/notification.html | 6 +++++-
tests/app/main/views/test_notifications.py | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/templates/views/notifications/notification.html b/app/templates/views/notifications/notification.html
index 808f21a86..72567c7aa 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 postal provider is unable to print the letter. Your letter has not been sent.
+
{% elif notification_status == 'technical-failure' %}
Technical failure – Notify will resend once the team have
diff --git a/tests/app/main/views/test_notifications.py b/tests/app/main/views/test_notifications.py
index 093b7849c..6ad7af8c5 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 postal provider is unable to print the letter. Your letter has not been sent.',
),
(
'cancelled',