mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
'Change' link links to edit_service_notes
This commit is contained in:
@@ -34,6 +34,7 @@ from app.main import main
|
||||
from app.main.forms import (
|
||||
BrandingOptions,
|
||||
ConfirmPasswordForm,
|
||||
EditServiceNotesForm,
|
||||
EstimateUsageForm,
|
||||
FreeSMSAllowance,
|
||||
LinkOrganisationsForm,
|
||||
@@ -1188,6 +1189,34 @@ def edit_data_retention(service_id, data_retention_id):
|
||||
)
|
||||
|
||||
|
||||
@main.route("/services/<uuid:service_id>/notes", methods=['GET', 'POST'])
|
||||
@user_has_permissions('manage_service')
|
||||
def edit_service_notes(service_id):
|
||||
form = EditServiceNotesForm()
|
||||
|
||||
if request.method == 'GET':
|
||||
form.name.data = current_service.notes
|
||||
|
||||
if form.validate_on_submit():
|
||||
|
||||
if form.notes.data == current_service.notes:
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
try:
|
||||
current_service.update(
|
||||
notes=form.notes.data
|
||||
)
|
||||
except HTTPError as e:
|
||||
raise e
|
||||
else:
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
return render_template(
|
||||
'views/service-settings/edit-service-notes.html',
|
||||
form=form,
|
||||
)
|
||||
|
||||
|
||||
def get_branding_as_value_and_label(email_branding):
|
||||
return [
|
||||
(branding['id'], branding['name'])
|
||||
|
||||
Reference in New Issue
Block a user