From d6b6f1689f0072969672c93b312681f767af4e69 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 9 May 2019 17:39:28 +0100 Subject: [PATCH 1/3] Remove copy-pasteable version of go live info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’ve automated this now so we don’t need it in a format that’s easy to copy and paste into a spreadsheet. --- app/main/views/service_settings.py | 24 ------------------- tests/app/main/views/test_service_settings.py | 4 ---- 2 files changed, 28 deletions(-) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 96261a3ff..c11e9631c 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -209,37 +209,17 @@ def submit_request_to_go_live(service_id): '\nConsent to research: {research_consent}' '\nOther live services: {existing_live}' '\n' - '\n---' - '\n' - '{service_id}, ' - '{organisation}, ' - '{service_name}, ' - '{user_name}, ' - '{user_email}, ' - '-, ' - '{date}, ' - '{volume_sms}, ' - '{volume_email}, ' - '{volume_letter}' ).format( service_name=current_service.name, service_dashboard=url_for('main.service_dashboard', service_id=current_service.id, _external=True), organisation_type=str(current_service.organisation_type).title(), agreement=current_service.organisation.as_human_readable(current_user.email_domain), checklist=current_service.go_live_checklist_completed_as_yes_no, - volume_email=print_if_number(current_service.volume_email), volume_email_formatted=format_if_number(current_service.volume_email), - volume_sms=print_if_number(current_service.volume_sms), volume_sms_formatted=format_if_number(current_service.volume_sms), - volume_letter=print_if_number(current_service.volume_letter), volume_letter_formatted=format_if_number(current_service.volume_letter), research_consent='Yes' if current_service.consent_to_research else 'No', existing_live='Yes' if user_api_client.user_has_live_services(current_user) else 'No', - service_id=current_service.id, - organisation=current_service.organisation.name, - user_name=current_user.name, - user_email=current_user.email_address, - date=datetime.now(tz=pytz.timezone('Europe/London')).strftime('%d/%m/%Y'), ), ticket_type=zendesk_client.TYPE_QUESTION, user_email=current_user.email_address, @@ -1069,9 +1049,5 @@ def check_contact_details_type(contact_details): return 'phone_number' -def print_if_number(value): - return value if isinstance(value, int) else '' - - def format_if_number(value): return '{:,.0f}'.format(value) if isinstance(value, int) else '' diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 58a26d1bd..131bba606 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -1385,10 +1385,6 @@ def test_should_redirect_after_request_to_go_live( '{formatted_displayed_volumes}' 'Consent to research: Yes\n' 'Other live services: No\n' - '\n' - '---\n' - '{service_id}, None, service one, Test User, test@user.gov.uk, -, 21/12/2012, ' - '{displayed_volumes}' ).format( service_id=SERVICE_ONE_ID, displayed_volumes=displayed_volumes, From 507b5b9933d2c77c6e38efdf9d15372c05ae24e5 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 9 May 2019 17:42:29 +0100 Subject: [PATCH 2/3] Remove line about checklist from go live email MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s impossible for people to go live without technically completing the checklist now. --- app/main/views/service_settings.py | 4 ---- tests/app/main/views/test_service_settings.py | 1 - 2 files changed, 5 deletions(-) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index c11e9631c..c41b08627 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -1,7 +1,5 @@ from collections import OrderedDict -from datetime import datetime -import pytz from flask import ( abort, current_app, @@ -202,7 +200,6 @@ def submit_request_to_go_live(service_id): '\n---' '\nOrganisation type: {organisation_type}' '\nAgreement signed: {agreement}' - '\nChecklist completed: {checklist}' '\nEmails in next year: {volume_email_formatted}' '\nText messages in next year: {volume_sms_formatted}' '\nLetters in next year: {volume_letter_formatted}' @@ -214,7 +211,6 @@ def submit_request_to_go_live(service_id): service_dashboard=url_for('main.service_dashboard', service_id=current_service.id, _external=True), organisation_type=str(current_service.organisation_type).title(), agreement=current_service.organisation.as_human_readable(current_user.email_domain), - checklist=current_service.go_live_checklist_completed_as_yes_no, volume_email_formatted=format_if_number(current_service.volume_email), volume_sms_formatted=format_if_number(current_service.volume_sms), volume_letter_formatted=format_if_number(current_service.volume_letter), diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 131bba606..e9a67b479 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -1381,7 +1381,6 @@ def test_should_redirect_after_request_to_go_live( '---\n' 'Organisation type: Central\n' 'Agreement signed: Can’t tell (domain is user.gov.uk)\n' - 'Checklist completed: No\n' '{formatted_displayed_volumes}' 'Consent to research: Yes\n' 'Other live services: No\n' From d01ed30da04afe8f8009525466b7394a65b2377b Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 14 May 2019 11:17:47 +0100 Subject: [PATCH 3/3] Keep email address in go live ticket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s useful because it’s not easy to see in the Zendesk UI. --- app/main/views/service_settings.py | 4 ++++ tests/app/main/views/test_service_settings.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index c41b08627..29a425e7f 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -206,6 +206,9 @@ def submit_request_to_go_live(service_id): '\nConsent to research: {research_consent}' '\nOther live services: {existing_live}' '\n' + '\n---' + '\nRequest sent by {email_address}' + '\n' ).format( service_name=current_service.name, service_dashboard=url_for('main.service_dashboard', service_id=current_service.id, _external=True), @@ -216,6 +219,7 @@ def submit_request_to_go_live(service_id): volume_letter_formatted=format_if_number(current_service.volume_letter), research_consent='Yes' if current_service.consent_to_research else 'No', existing_live='Yes' if user_api_client.user_has_live_services(current_user) else 'No', + email_address=current_user.email_address, ), ticket_type=zendesk_client.TYPE_QUESTION, user_email=current_user.email_address, diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index e9a67b479..c9723d509 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -1384,6 +1384,9 @@ def test_should_redirect_after_request_to_go_live( '{formatted_displayed_volumes}' 'Consent to research: Yes\n' 'Other live services: No\n' + '\n' + '---\n' + 'Request sent by test@user.gov.uk\n' ).format( service_id=SERVICE_ONE_ID, displayed_volumes=displayed_volumes,