From ce704a979dc1af11c2b8e4d5941c276c0663ecfc Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 8 Mar 2018 15:28:59 +0000 Subject: [PATCH] Add what we know of agreements to go live request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we process a go live request it’s a pain to have to go fishing in the Google Drive to see if there’s a signed agreement in there. This should make it easier when we know there’s already an agreement. --- app/main/views/service_settings.py | 4 ++++ tests/app/main/views/test_service_settings.py | 1 + 2 files changed, 5 insertions(+) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index fd2479714..03d298d7d 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -44,6 +44,7 @@ from app.main.forms import ( SMSPrefixForm, ) from app.utils import ( + GovernmentDomain, email_safe, get_cdn_domain, user_has_permissions, @@ -171,6 +172,7 @@ def request_to_go_live(service_id): @user_has_permissions('manage_service') def submit_request_to_go_live(service_id): form = RequestToGoLiveForm() + agreement_info = GovernmentDomain.from_current_user() if form.validate_on_submit(): try: @@ -180,6 +182,7 @@ def submit_request_to_go_live(service_id): 'On behalf of {} ({})\n' '\n---' '\nOrganisation type: {}' + '\nAgreement signed: {} ({})' '\nMOU in place: {}' '\nChannel: {}\nStart date: {}\nStart volume: {}' '\nPeak volume: {}' @@ -188,6 +191,7 @@ def submit_request_to_go_live(service_id): current_service['name'], url_for('main.service_dashboard', service_id=current_service['id'], _external=True), current_service['organisation_type'], + agreement_info.agreement_signed, agreement_info.owner, form.mou.data, formatted_list(filter(None, ( 'email' if form.channel_email.data else None, diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index e31f3737b..8e6bd7e7d 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -530,6 +530,7 @@ def test_should_redirect_after_request_to_go_live( returned_message = mock_post.call_args[1]['message'] assert 'On behalf of service one' in returned_message assert 'Organisation type: central' in returned_message + assert 'Agreement signed: None (None)' in returned_message assert 'Channel: email and text messages' in returned_message assert 'Start date: 01/01/2017' in returned_message assert 'Start volume: 100,000' in returned_message