mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 17:33:12 -04:00
set current services's values on service branding form
This commit is contained in:
@@ -272,24 +272,19 @@ def service_set_sms_sender(service_id):
|
|||||||
@login_required
|
@login_required
|
||||||
@user_has_permissions(admin_override=True)
|
@user_has_permissions(admin_override=True)
|
||||||
def service_set_branding_and_org(service_id):
|
def service_set_branding_and_org(service_id):
|
||||||
|
|
||||||
print(">>>"*30)
|
|
||||||
print("fffffuuuuu")
|
|
||||||
|
|
||||||
organisations = organisations_client.get_organisations()
|
organisations = organisations_client.get_organisations()
|
||||||
|
|
||||||
# get current service branding
|
form = ServiceBrandingOrg(branding_type=current_service.get('branding'))
|
||||||
form = ServiceBrandingOrg(
|
# dynamically create org choices, including the null option
|
||||||
branding_type=current_service.get('branding'),
|
|
||||||
organisation=current_service.get('organisation')
|
|
||||||
)
|
|
||||||
form.organisation.choices = [('', 'None')] + get_branding_as_value_and_label(organisations)
|
form.organisation.choices = [('', 'None')] + get_branding_as_value_and_label(organisations)
|
||||||
|
form.organisation.data = current_service['organisation'] or ''
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
|
organisation = None if form.organisation.data == '' else form.organisation.data
|
||||||
service_api_client.update_service(
|
service_api_client.update_service(
|
||||||
service_id,
|
service_id,
|
||||||
branding=form.branding_type.data,
|
branding=form.branding_type.data,
|
||||||
organisation=form.organisation.data
|
organisation=organisation
|
||||||
)
|
)
|
||||||
return redirect(url_for('.service_settings', service_id=service_id))
|
return redirect(url_for('.service_settings', service_id=service_id))
|
||||||
return render_template(
|
return render_template(
|
||||||
|
|||||||
Reference in New Issue
Block a user