From 3732e45126d934547d0171aa5ccdfc3775047b7b Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Mon, 21 Oct 2019 14:34:46 +0100 Subject: [PATCH] Stop allowing uploaded letters to be sent for trial mode services We weren't checking if a service was in trial mode when they try to send an uploaded file. If a service is in trial mode, we now show a banner at the top of the preview page and no send button. --- app/templates/views/uploads/preview.html | 10 +++++- tests/app/main/views/test_uploads.py | 42 ++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/app/templates/views/uploads/preview.html b/app/templates/views/uploads/preview.html index 8ecc96a3e..c448b3b4d 100644 --- a/app/templates/views/uploads/preview.html +++ b/app/templates/views/uploads/preview.html @@ -14,6 +14,14 @@

{{ error.detail | safe }}

{% endif %} {% endcall %} + {% elif current_service.trial_mode %} + {% call banner_wrapper(type='dangerous') %} + {% with + count_of_recipients=1 + %} + {% include "partials/check/trying-to-send-letters-in-trial-mode.html" %} + {% endwith %} + {% endcall %} {% else %} {{ page_header( original_filename, @@ -25,7 +33,7 @@ {{ template|string }} - {% if status == 'valid' %} + {% if status == 'valid' and current_service.live %}