Show if letters are sent using a test key

It’s inaccurate to have an estimated delivery date for letters sent
using a test key. We shouldn’t reassure people that:
- the letter won’t be printed
- (in the case of precompiled letters) that the letter has passed
  validation
This commit is contained in:
Chris Hill-Scott
2019-01-17 14:22:58 +00:00
parent 63889cb047
commit cfcdfcc38c
4 changed files with 108 additions and 17 deletions

View File

@@ -125,7 +125,10 @@ def view_notification(service_id, notification_id):
can_receive_inbound=(current_service.has_permission('inbound_sms')),
is_precompiled_letter=notification['template']['is_precompiled_letter'],
letter_print_day=letter_print_day,
show_cancel_button=show_cancel_button
show_cancel_button=show_cancel_button,
sent_with_test_key=(
notification.get('key_type') == KEY_TYPE_TEST
),
)

View File

@@ -16,7 +16,7 @@
<p>
{% if is_precompiled_letter %}
Provided as PDF
Provided as PDF
{% else %}
{% if help %}
{{ template.name }}
@@ -51,15 +51,31 @@
fixed the problem
</p>
{% else %}
<p>
{{ letter_print_day }}
</p>
<p>
Postage: {{ postage }} class
</p>
<p>
Estimated delivery date: {{ estimated_letter_delivery_date|string|format_date_short }}
</p>
{% if sent_with_test_key %}
<p>
Postage: {{ postage }} class
</p>
{% if is_precompiled_letter %}
<p>
This letter has passed our checks, but it wont be printed
because you used a test key
</p>
{% else %}
<p>
This letter wont be printed because you used a test key
</p>
{% endif %}
{% else %}
<p>
{{ letter_print_day }}
</p>
<p>
Postage: {{ postage }} class
</p>
<p>
Estimated delivery date: {{ estimated_letter_delivery_date|string|format_date_short }}
</p>
{% endif %}
{% endif %}
{% endif %}