From 5108187cabd5a13149f572d2dcf2538b759e1ec1 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 7 Aug 2018 11:45:19 +0100 Subject: [PATCH] Show letters in basic view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were taking letters away from basic view because there’s no one-off sending of letters. But now that basic view isn’t an opt-in thing but something we’re rolling out to all users who only have the ‘send’ permission it feels like too drastic a change to remove letters. --- app/main/views/templates.py | 5 +---- tests/app/main/views/test_templates.py | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index bbc501e41..cacbf68ab 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -111,10 +111,7 @@ def start_tour(service_id, template_id): def choose_template(service_id, template_type='all'): templates = service_api_client.get_service_templates(service_id)['data'] - letters_available = ( - current_service.has_permission('letter') and - current_user.has_permissions('view_activity') - ) + letters_available = current_service.has_permission('letter') available_template_types = list(filter(None, ( 'email', diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index e3ddec5fc..4b4dcbf99 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -74,19 +74,21 @@ from tests.conftest import single_letter_contact_block active_caseworking_user, 'Templates', {}, - ['Text message', 'Email'], + ['Text message', 'Email', 'Letter'], [ 'sms_template_one', 'sms_template_two', 'email_template_one', 'email_template_two', + 'letter_template_one', + 'letter_template_two', ], ), ( active_caseworking_user, 'Templates', {'template_type': 'email'}, - ['All', 'Text message'], + ['All', 'Text message', 'Letter'], ['email_template_one', 'email_template_two'], ), ]