mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user