Add page to change organisation type

If a user picks the wrong thing, we should be able to override it when
they go live.
This commit is contained in:
Chris Hill-Scott
2017-10-05 12:06:40 +01:00
parent 8cc8a0bf05
commit d438109630
5 changed files with 133 additions and 12 deletions

View File

@@ -34,6 +34,7 @@ from app.main.forms import (
LetterBranding,
ServiceInboundApiForm,
InternationalSMSForm,
OrganisationTypeForm,
)
from app import user_api_client, current_service, organisations_client, inbound_number_client
from notifications_utils.formatters import formatted_list
@@ -574,6 +575,28 @@ def service_set_letter_contact_block(service_id):
)
@main.route("/services/<service_id>/service-settings/set-organisation-type", methods=['GET', 'POST'])
@login_required
@user_has_permissions(admin_override=True)
def set_organisation_type(service_id):
form = OrganisationTypeForm(organisation_type=current_service.get('organisation_type'))
if form.validate_on_submit():
service_api_client.update_service(
service_id,
organisation_type=form.organisation_type.data,
)
return redirect(url_for('.service_settings', service_id=service_id))
form.organisation_type.data = current_service.get('organisation_type')
return render_template(
'views/service-settings/set-organisation-type.html',
form=form,
)
@main.route("/services/<service_id>/service-settings/set-branding-and-org", methods=['GET', 'POST'])
@login_required
@user_has_permissions(admin_override=True)