#446 remove crown

This commit is contained in:
Kenneth Kehl
2023-04-13 07:13:04 -07:00
parent 6587ed5223
commit 65ea248429
23 changed files with 47 additions and 276 deletions

View File

@@ -1145,18 +1145,6 @@ class OrganisationOrganisationTypeForm(StripWhitespaceForm):
organisation_type = OrganisationTypeField('What type of organization is this?')
class OrganisationCrownStatusForm(StripWhitespaceForm):
crown_status = GovukRadiosField(
'Is this organization a crown body?',
choices=[
('crown', 'Yes'),
('non-crown', 'No'),
('unknown', 'Not sure'),
],
thing='whether this organization is a crown body',
)
class OrganisationAgreementSignedForm(StripWhitespaceForm):
agreement_signed = GovukRadiosField(
'Has this organization signed the agreement?',
@@ -1209,13 +1197,10 @@ class CreateServiceForm(StripWhitespaceForm):
class AdminNewOrganisationForm(
RenameOrganisationForm,
OrganisationOrganisationTypeForm,
OrganisationCrownStatusForm,
OrganisationOrganisationTypeForm
):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Dont offer the not sure choice
self.crown_status.choices = self.crown_status.choices[:-1]
class AdminServiceSMSAllowanceForm(StripWhitespaceForm):

View File

@@ -23,8 +23,6 @@ def service_agreement(service_id):
return redirect(
url_for('main.add_organisation_from_nhs_local_service', service_id=current_service.id)
)
if current_service.organisation.crown is None:
return render_template('views/agreement/service-agreement-choose.html')
if current_service.organisation.agreement_signed:
return render_template('views/agreement/service-agreement-signed.html')
return render_template('views/agreement/service-agreement.html')
@@ -34,7 +32,6 @@ def service_agreement(service_id):
@user_has_permissions('manage_service')
def service_download_agreement(service_id):
return send_file(**get_mou(
current_service.organisation.crown_status_or_404
))
@@ -85,13 +82,13 @@ def service_confirm_agreement(service_id):
@main.route('/agreement/<variant>', endpoint='public_agreement')
@main.route('/agreement/<variant>.pdf', endpoint='public_download_agreement')
def public_agreement(variant):
if variant not in {'crown', 'non-crown'}:
# originally we returned 404 if variant was not in ['crown', 'not_crown']. Will we be using agreement.pdf?
# for now this is just to keep tests working as expected.
if variant != "agreement":
abort(404)
if request.endpoint == 'main.public_download_agreement':
return send_file(**get_mou(
organisation_is_crown=(variant == 'crown')
))
return render_template(

View File

@@ -23,7 +23,6 @@ from app.main.forms import (
AdminSetEmailBrandingForm,
InviteOrgUserForm,
OrganisationAgreementSignedForm,
OrganisationCrownStatusForm,
OrganisationOrganisationTypeForm,
RenameOrganisationForm,
SearchByNameForm,
@@ -278,35 +277,6 @@ def edit_organisation_type(org_id):
)
@main.route("/organisations/<uuid:org_id>/settings/edit-crown-status", methods=['GET', 'POST'])
@user_is_platform_admin
def edit_organisation_crown_status(org_id):
form = OrganisationCrownStatusForm(
crown_status={
True: 'crown',
False: 'non-crown',
None: 'unknown',
}.get(current_organisation.crown)
)
if form.validate_on_submit():
organisations_client.update_organisation(
current_organisation.id,
crown={
'crown': True,
'non-crown': False,
'unknown': None,
}.get(form.crown_status.data),
)
return redirect(url_for('.organisation_settings', org_id=org_id))
return render_template(
'views/organisations/organisation/settings/edit-crown-status.html',
form=form,
)
@main.route("/organisations/<uuid:org_id>/settings/edit-agreement", methods=['GET', 'POST'])
@user_is_platform_admin
def edit_organisation_agreement(org_id):
@@ -500,5 +470,5 @@ def organisation_billing(org_id):
@user_is_platform_admin
def organisation_download_agreement(org_id):
return send_file(**get_mou(
current_organisation.crown_status_or_404
))