Add page to change a service's contact link

Added a page which lets users with the 'manage_service' permission change the
contact link for their service. There are no links to this page yet
since only services using document download will need to set a contact
link.
This commit is contained in:
Katie Smith
2018-06-05 10:37:41 +01:00
parent 1fc4e1657d
commit e1d4181be3
7 changed files with 125 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ from app.main.forms import (
OrganisationTypeForm,
RenameServiceForm,
RequestToGoLiveForm,
ServiceContactLinkForm,
ServiceEditInboundNumberForm,
ServiceInboundNumberForm,
ServiceLetterContactBlockForm,
@@ -366,6 +367,25 @@ def resume_service(service_id):
return service_settings(service_id)
@main.route("/services/<service_id>/service-settings/contact-link", methods=['GET', 'POST'])
@login_required
@user_has_permissions('manage_service')
def service_set_contact_link(service_id):
form = ServiceContactLinkForm()
if request.method == 'GET':
form.url.data = current_service.get('contact_link')
if form.validate_on_submit():
service_api_client.update_service(
current_service['id'],
contact_link=form.url.data
)
return redirect(url_for('.service_settings', service_id=current_service['id']))
return render_template('views/service-settings/contact_link.html', form=form)
@main.route("/services/<service_id>/service-settings/set-email", methods=['GET'])
@login_required
@user_has_permissions('manage_service')