Merge pull request #3924 from alphagov/letter-permanent-failure

Permanent failure message for letters
This commit is contained in:
Rebecca Law
2021-06-15 13:43:26 +01:00
committed by GitHub
5 changed files with 9 additions and 4 deletions

View File

@@ -220,7 +220,7 @@ def format_notification_status(status, template_type):
'failed': '', 'failed': '',
'technical-failure': 'Technical failure', 'technical-failure': 'Technical failure',
'temporary-failure': '', 'temporary-failure': '',
'permanent-failure': '', 'permanent-failure': 'Permanent failure',
'delivered': '', 'delivered': '',
'received': '', 'received': '',
'accepted': '', 'accepted': '',

View File

@@ -80,6 +80,7 @@
('Printed', 'The provider has printed the letter. Letters are printed at 5:30pm and dispatched the next working day.'), ('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.'), ('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.'), ('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() %} {% call row() %}
{{ text_field(message_length) }} {{ text_field(message_length) }}

View File

@@ -41,7 +41,7 @@
</p> </p>
{% if template.template_type == 'letter' %} {% if template.template_type == 'letter' %}
{% if notification_status in ('permanent-failure', 'cancelled') %} {% if notification_status == 'cancelled' %}
<p class="notification-status-cancelled"> <p class="notification-status-cancelled">
Cancelled {{ updated_at|format_datetime_short }} Cancelled {{ updated_at|format_datetime_short }}
</p> </p>
@@ -49,6 +49,10 @@
<p class="notification-status-cancelled"> <p class="notification-status-cancelled">
{{ message.summary | safe }} {{ message.summary | safe }}
</p> </p>
{% elif notification_status == 'permanent-failure' %}
<p class="notification-status-cancelled">
Permanent failure The provider cannot print the letter. Your letter will not be dispatched.
</p>
{% elif notification_status == 'technical-failure' %} {% elif notification_status == 'technical-failure' %}
<p class="notification-status-cancelled"> <p class="notification-status-cancelled">
Technical failure Notify will resend once the team have Technical failure Notify will resend once the team have

View File

@@ -741,7 +741,7 @@ def test_big_numbers_dont_show_for_letters(
('letter', 'received', '27 September at 5:30pm', True), ('letter', 'received', '27 September at 5:30pm', True),
('letter', 'accepted', '27 September at 5:30pm', True), ('letter', 'accepted', '27 September at 5:30pm', True),
('letter', 'cancelled', '27 September at 5:30pm', False), # The API wont return cancelled letters ('letter', 'cancelled', '27 September at 5:30pm', False), # The API wont 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', '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', 'virus-scan-failed', 'Virus detected 27 September at 5:30pm', False),
('letter', 'validation-failed', 'Validation failed 27 September at 5:30pm', False), ('letter', 'validation-failed', 'Validation failed 27 September at 5:30pm', False),

View File

@@ -442,7 +442,7 @@ def test_notification_page_shows_validation_failed_precompiled_letter(
@pytest.mark.parametrize('notification_status, expected_message', ( @pytest.mark.parametrize('notification_status, expected_message', (
( (
'permanent-failure', 'permanent-failure',
'Cancelled 1 January at 1:02am', 'Permanent failure The provider cannot print the letter. Your letter will not be dispatched.',
), ),
( (
'cancelled', 'cancelled',