Stop allowing the service org type to be changed

The service organisation type will either be the same as the org type of
the service's organisation or will be set by a user when creating a new
service. This removes the ability to change it from the platform admin
settings table.
This commit is contained in:
Katie Smith
2019-07-08 09:44:22 +01:00
parent 3167c6dc31
commit 53214937a8
6 changed files with 56 additions and 133 deletions

View File

@@ -591,10 +591,6 @@ class CreateServiceForm(StripWhitespaceForm):
organisation_type = organisation_type()
class OrganisationTypeForm(StripWhitespaceForm):
organisation_type = organisation_type()
class NewOrganisationForm(
RenameOrganisationForm,
OrganisationOrganisationTypeForm,

View File

@@ -36,7 +36,6 @@ from app.main.forms import (
FreeSMSAllowance,
InternationalSMSForm,
LinkOrganisationsForm,
OrganisationTypeForm,
PreviewBranding,
RenameServiceForm,
SearchByNameForm,
@@ -860,29 +859,6 @@ def service_set_letter_contact_block(service_id):
)
@main.route("/services/<service_id>/service-settings/set-organisation-type", methods=['GET', 'POST'])
@user_is_platform_admin
def set_organisation_type(service_id):
form = OrganisationTypeForm(organisation_type=current_service.organisation_type)
if form.validate_on_submit():
free_sms_fragment_limit = current_app.config['DEFAULT_FREE_SMS_FRAGMENT_LIMITS'].get(
form.organisation_type.data)
current_service.update(
organisation_type=form.organisation_type.data,
)
billing_api_client.create_or_update_free_sms_fragment_limit(service_id, free_sms_fragment_limit)
return redirect(url_for('.service_settings', service_id=service_id))
return render_template(
'views/service-settings/set-organisation-type.html',
form=form,
)
@main.route("/services/<service_id>/service-settings/set-free-sms-allowance", methods=['GET', 'POST'])
@user_is_platform_admin
def set_free_sms_allowance(service_id):