mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Add pages to let users accept the agreement online
At the moment, the process for accepting the data sharing and financial agreement is: 1. download a pdf * print it out * get someone to sign it * scan it * email it back to us * we rename the file and save it in Google Drive * we then update the organisation to say the MOU is signed * sometimes we also: * print it out and get it counter-signed * scan it again * email it back to the service Let's not do that any more. When the first service for an organisation that doesn't have the agreement in place is in the process of going live, then they should be able to accept the agreement online as part of the go live flow. This commit adds the pages that let someone do that. Where the checklist shows the agreement as **[not completed]** then they can follow a link where they can download it (as happens now). From here, they should then also be able to provide some info to accept it. The info that we need is: **Version** – because we version the agreements occasionally, we need to know which version they are accepting. It may not be the latest one if they downloaded it a while ago and it took time to be signed off **Who is accepting the agreement** – this will often be someone in the finance team, and not necessarily a team member, so we should let the person either accept as themselves, or on behalf of someone else. If it's on behalf of someone else we need to the name and email address of that person so we have that on record. Obvs if it's them accepting it themselves, we have that already (so we just store their user ID and not their name or email address). We then replay the collected info back in a sort of legally binding kind of way pulling in the organisation name too. The wording we’re using is inspired by what GOV.UK Pay have. Then there’s a big green button they can click to accept the agreement, which stores their user ID and and timestamp.
This commit is contained in:
@@ -110,3 +110,9 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.conditional-radio-panel {
|
||||
border-left: 4px solid $border-colour;
|
||||
margin: -20px 0 0 17px;
|
||||
padding: 10px 0 0 28px;
|
||||
}
|
||||
|
||||
@@ -1462,3 +1462,41 @@ class GoLiveNotesForm(StripWhitespaceForm):
|
||||
'Go live notes',
|
||||
filters=[lambda x: x or None],
|
||||
)
|
||||
|
||||
|
||||
class AcceptAgreementForm(StripWhitespaceForm):
|
||||
|
||||
version = StringField(
|
||||
'Which version of the agreement are you accepting?'
|
||||
)
|
||||
|
||||
who = RadioField(
|
||||
'Who is accepting the agreement?',
|
||||
choices=(
|
||||
(
|
||||
'me',
|
||||
'I’m accepting the agreement',
|
||||
),
|
||||
(
|
||||
'someone-else',
|
||||
'I’m accepting the agreement on behalf of someone else',
|
||||
),
|
||||
),
|
||||
validators=[DataRequired()],
|
||||
)
|
||||
|
||||
on_behalf_of_name = StringField(
|
||||
'Who are you accepting the agreement on behalf of?'
|
||||
)
|
||||
|
||||
on_behalf_of_email = email_address(
|
||||
'What’s their email address?',
|
||||
required=False,
|
||||
gov_user=False,
|
||||
)
|
||||
|
||||
def validate_version(self, field):
|
||||
try:
|
||||
float(field.data)
|
||||
except (TypeError, ValueError):
|
||||
raise ValidationError("Must be a number")
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
from flask import abort, render_template, request, send_file, url_for
|
||||
from datetime import datetime
|
||||
|
||||
from flask import abort, redirect, render_template, request, send_file, url_for
|
||||
from flask_login import current_user, login_required
|
||||
|
||||
from app import current_service
|
||||
from app.main import main
|
||||
from app.main.forms import AcceptAgreementForm
|
||||
from app.main.views.sub_navigation_dictionaries import features_nav
|
||||
from app.s3_client.s3_mou_client import get_mou
|
||||
|
||||
@@ -26,6 +29,60 @@ def service_agreement(service_id):
|
||||
)
|
||||
|
||||
|
||||
@main.route('/services/<uuid:service_id>/agreement/accept', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def service_accept_agreement(service_id):
|
||||
|
||||
org = current_service.organisation
|
||||
|
||||
if not org:
|
||||
abort(404)
|
||||
|
||||
form = AcceptAgreementForm(
|
||||
version=org.agreement_signed_version,
|
||||
who='someone-else' if (
|
||||
org.agreement_signed_on_behalf_of_name
|
||||
and org.agreement_signed_on_behalf_of_email_address
|
||||
) else 'me',
|
||||
on_behalf_of_name=org.agreement_signed_on_behalf_of_name,
|
||||
on_behalf_of_email=org.agreement_signed_on_behalf_of_email_address,
|
||||
)
|
||||
|
||||
if form.validate_on_submit():
|
||||
current_service.organisation.update(
|
||||
agreement_signed_version=float(form.version.data),
|
||||
agreement_signed_on_behalf_of_name=form.on_behalf_of_name.data,
|
||||
agreement_signed_on_behalf_of_email_address=form.on_behalf_of_email.data,
|
||||
)
|
||||
return redirect(url_for('main.service_confirm_agreement', service_id=current_service.id))
|
||||
|
||||
return render_template(
|
||||
'views/agreement/agreement-accept.html',
|
||||
form=form,
|
||||
)
|
||||
|
||||
|
||||
@main.route('/services/<uuid:service_id>/agreement/confirm', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def service_confirm_agreement(service_id):
|
||||
|
||||
if (
|
||||
not current_service.organisation
|
||||
or current_service.organisation.agreement_signed_version is None
|
||||
):
|
||||
abort(403)
|
||||
|
||||
if request.method == 'POST':
|
||||
current_service.organisation.update(
|
||||
agreement_signed=True,
|
||||
agreement_signed_at=str(datetime.utcnow()),
|
||||
agreement_signed_by_id=current_user.id,
|
||||
)
|
||||
return redirect(url_for('main.request_to_go_live', service_id=current_service.id))
|
||||
|
||||
return render_template('views/agreement/agreement-confirm.html')
|
||||
|
||||
|
||||
@main.route('/agreement.pdf')
|
||||
@login_required
|
||||
def download_agreement():
|
||||
|
||||
@@ -19,6 +19,8 @@ class Organisation(JSONModel):
|
||||
'agreement_signed_at',
|
||||
'agreement_signed_by_id',
|
||||
'agreement_signed_version',
|
||||
'agreement_signed_on_behalf_of_name',
|
||||
'agreement_signed_on_behalf_of_email_address',
|
||||
'domains',
|
||||
'request_to_go_live_notes',
|
||||
'count_of_live_services',
|
||||
@@ -156,6 +158,10 @@ class Organisation(JSONModel):
|
||||
key=lambda user: user.email_address.lower(),
|
||||
)
|
||||
|
||||
def update(self, **kwargs):
|
||||
response = organisations_client.update_organisation(self.id, **kwargs)
|
||||
self.__init__(response)
|
||||
|
||||
|
||||
class Organisations(ModelList):
|
||||
client = organisations_client.get_organisations
|
||||
|
||||
@@ -244,6 +244,8 @@ class HeaderNavigation(Navigation):
|
||||
'service_add_letter_contact',
|
||||
'service_add_sms_sender',
|
||||
'service_agreement',
|
||||
'service_accept_agreement',
|
||||
'service_confirm_agreement',
|
||||
'service_confirm_delete_email_reply_to',
|
||||
'service_confirm_delete_sms_sender',
|
||||
'service_dashboard',
|
||||
@@ -377,6 +379,8 @@ class MainNavigation(Navigation):
|
||||
'service_add_letter_contact',
|
||||
'service_add_sms_sender',
|
||||
'service_agreement',
|
||||
'service_accept_agreement',
|
||||
'service_confirm_agreement',
|
||||
'service_confirm_delete_email_reply_to',
|
||||
'service_confirm_delete_sms_sender',
|
||||
'service_edit_email_reply_to',
|
||||
@@ -765,6 +769,8 @@ class CaseworkNavigation(Navigation):
|
||||
'service_add_letter_contact',
|
||||
'service_add_sms_sender',
|
||||
'service_agreement',
|
||||
'service_accept_agreement',
|
||||
'service_confirm_agreement',
|
||||
'service_confirm_delete_email_reply_to',
|
||||
'service_confirm_delete_sms_sender',
|
||||
'service_dashboard',
|
||||
@@ -1034,6 +1040,8 @@ class OrgNavigation(Navigation):
|
||||
'service_add_letter_contact',
|
||||
'service_add_sms_sender',
|
||||
'service_agreement',
|
||||
'service_accept_agreement',
|
||||
'service_confirm_agreement',
|
||||
'service_confirm_delete_email_reply_to',
|
||||
'service_confirm_delete_sms_sender',
|
||||
'service_dashboard',
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<p>
|
||||
Before you can go live on GOV.UK Notify, your organisation needs to agree to our data sharing and financial agreement.
|
||||
To use GOV.UK Notify your organisation (Cabinet Office) must accept the GOV.UK Notify data sharing and financial agreement.
|
||||
</p>
|
||||
<p>
|
||||
This agreement only needs to be accepted once and will then cover all Notify services from
|
||||
{{ current_service.organisation.name }}.
|
||||
</p>
|
||||
<p>
|
||||
It needs to be accepted by, or on behalf of someone who can sign contracts for your organisation.
|
||||
</p>
|
||||
<p>
|
||||
<a href="{{ url_for('main.download_agreement') }}">Download a copy of the agreement</a>.
|
||||
</p>
|
||||
<ol class="list list-number">
|
||||
<li>
|
||||
<a href="{{ url_for('main.download_agreement') }}">Download the agreement</a>.
|
||||
</li>
|
||||
<li>
|
||||
Get it signed by someone who has the authority to do so on behalf of {{ owner }}.
|
||||
</li>
|
||||
<li>
|
||||
Return the signed copy to <a href="mailto:notify-support@digital.cabinet-office.gov.uk">notify-support@digital.cabinet-office.gov.uk</a>.
|
||||
</li>
|
||||
</ol>
|
||||
<p>
|
||||
The agreement contains commercially sensitive information, so don’t share it more widely than you need to.
|
||||
</p>
|
||||
<a href="{{ url_for('main.service_accept_agreement', service_id=current_service.id) }}" class="button">Continue</a>
|
||||
|
||||
37
app/templates/views/agreement/agreement-accept.html
Normal file
37
app/templates/views/agreement/agreement-accept.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
{% from "components/radios.html" import radios %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Accept data sharing and financial agreement
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-five-sixths">
|
||||
|
||||
{{ page_header(
|
||||
'Accept data sharing and financial agreement',
|
||||
back_link=url_for('main.service_agreement', service_id=current_service.id)
|
||||
) }}
|
||||
|
||||
{% call form_wrapper(class='top-gutter') %}
|
||||
|
||||
{{ textbox(form.version, width='1-3', hint='The version number is on the front page, for example ‘3.6’') }}
|
||||
{{ radios(form.who) }}
|
||||
<div class="conditional-radio-panel" id="on-behalf-of">
|
||||
{{ textbox(form.on_behalf_of_name, width='1-1') }}
|
||||
{{ textbox(form.on_behalf_of_email, width='1-1') }}
|
||||
</div>
|
||||
{{ page_footer('Continue') }}
|
||||
|
||||
{% endcall %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
39
app/templates/views/agreement/agreement-confirm.html
Normal file
39
app/templates/views/agreement/agreement-confirm.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
|
||||
{% block per_page_title %}
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-five-sixths">
|
||||
|
||||
{{ page_header(
|
||||
'GOV.UK Notify data sharing and financial agreement',
|
||||
back_link=url_for('main.service_accept_agreement', service_id=current_service.id)
|
||||
) }}
|
||||
|
||||
{% call form_wrapper(class='top-gutter') %}
|
||||
|
||||
{% if current_service.organisation.agreement_signed_on_behalf_of_name and current_service.organisation.agreement_signed_on_behalf_of_email_address %}
|
||||
<p>
|
||||
I confirm that I have the legal authority to accept the GOV.UK Notify data sharing and financial agreement (version {{ current_service.organisation.agreement_signed_version }}) on behalf of {{ current_service.organisation.agreement_signed_on_behalf_of_name }} ({{ current_service.organisation.agreement_signed_on_behalf_of_email_address }}) and that {{ current_service.organisation.name }} will be bound by it.
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
I confirm that I have the legal authority to accept the GOV.UK Notify data sharing and financial agreement (version {{ current_service.organisation.agreement_signed_version }}) and that {{ current_service.organisation.name }} will be bound by it.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{{ page_footer('Accept this agreement') }}
|
||||
|
||||
{% endcall %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user