mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 05:29:38 -04:00
Only offer agreement download to non-crown for now
We don’t have the crown agreement in a nice downloadable format at the moment.
This commit is contained in:
@@ -159,7 +159,11 @@ rpa.gov.uk:
|
|||||||
agreement_signed: true
|
agreement_signed: true
|
||||||
mcga.gov.uk:
|
mcga.gov.uk:
|
||||||
owner: Maritime and Coastguard Agency
|
owner: Maritime and Coastguard Agency
|
||||||
agreement_signed: true
|
agreement_signed: true
|
||||||
|
metoffice.gov.uk:
|
||||||
|
owner: Met Office
|
||||||
|
agreement_signed: false
|
||||||
|
crown: true
|
||||||
|
|
||||||
# Local Government
|
# Local Government
|
||||||
aberdeencityandshire-sdpa.gov.uk:
|
aberdeencityandshire-sdpa.gov.uk:
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ from flask import render_template, send_file
|
|||||||
from flask_login import login_required
|
from flask_login import login_required
|
||||||
|
|
||||||
from app.main import main
|
from app.main import main
|
||||||
from app.main.views.sub_navigation_dictionaries import features_nav
|
|
||||||
from app.main.s3_client import get_mou
|
from app.main.s3_client import get_mou
|
||||||
|
from app.main.views.sub_navigation_dictionaries import features_nav
|
||||||
from app.utils import AgreementInfo
|
from app.utils import AgreementInfo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@main.route('/agreement')
|
@main.route('/agreement')
|
||||||
@login_required
|
@login_required
|
||||||
def agreement():
|
def agreement():
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ class AgreementInfo:
|
|||||||
'agreement.'.format(self.owner)
|
'agreement.'.format(self.owner)
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.crown_status is not None:
|
if self.crown_status is False:
|
||||||
return ((
|
return ((
|
||||||
'{} <a href="{}">Download a copy</a>.'
|
'{} <a href="{}">Download a copy</a>.'
|
||||||
).format(self._acceptance_required, download_link))
|
).format(self._acceptance_required, download_link))
|
||||||
@@ -504,7 +504,7 @@ class AgreementInfo:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def crown_status_or_404(self):
|
def crown_status_or_404(self):
|
||||||
if self.crown_status is None:
|
if self.crown_status in {None, True}:
|
||||||
abort(404)
|
abort(404)
|
||||||
return self.crown_status
|
return self.crown_status
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class _MockS3Object():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('email_address, expected_status', [
|
@pytest.mark.parametrize('email_address, expected_status', [
|
||||||
('test@cabinet-office.gov.uk', 200),
|
('test@cabinet-office.gov.uk', 404),
|
||||||
('test@aylesburytowncouncil.gov.uk', 200),
|
('test@aylesburytowncouncil.gov.uk', 200),
|
||||||
('test@unknown.gov.uk', 404),
|
('test@unknown.gov.uk', 404),
|
||||||
])
|
])
|
||||||
@@ -36,11 +36,11 @@ def test_show_agreement_page(
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('email_address, expected_file_fetched, expected_file_served', [
|
@pytest.mark.parametrize('email_address, expected_file_fetched, expected_file_served', [
|
||||||
(
|
pytest.mark.xfail((
|
||||||
'test@cabinet-office.gov.uk',
|
'test@cabinet-office.gov.uk',
|
||||||
'crown.pdf',
|
'crown.pdf',
|
||||||
'GOV.UK Notify data sharing and financial agreement.pdf',
|
'GOV.UK Notify data sharing and financial agreement.pdf',
|
||||||
),
|
), raises=AssertionError),
|
||||||
(
|
(
|
||||||
'test@aylesburytowncouncil.gov.uk',
|
'test@aylesburytowncouncil.gov.uk',
|
||||||
'non-crown.pdf',
|
'non-crown.pdf',
|
||||||
|
|||||||
@@ -155,6 +155,23 @@ def test_terms_is_generic_if_user_is_not_logged_in(
|
|||||||
'we already have one in place with your organisation.'
|
'we already have one in place with your organisation.'
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
'michael.fish@metoffice.gov.uk',
|
||||||
|
(
|
||||||
|
'Your organisation (Met Office) must also accept our data '
|
||||||
|
'sharing and financial agreement. Contact us to get a copy.'
|
||||||
|
),
|
||||||
|
partial(
|
||||||
|
url_for,
|
||||||
|
'main.feedback',
|
||||||
|
ticket_type='ask-question-give-feedback',
|
||||||
|
body='agreement-with-owner',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'Contact us to get a copy of the agreement (Met Office '
|
||||||
|
'hasn’t accepted it yet).'
|
||||||
|
),
|
||||||
|
),
|
||||||
])
|
])
|
||||||
def test_terms_tells_logged_in_users_what_we_know_about_their_agreement(
|
def test_terms_tells_logged_in_users_what_we_know_about_their_agreement(
|
||||||
mocker,
|
mocker,
|
||||||
|
|||||||
Reference in New Issue
Block a user