mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-13 01:44:08 -04:00
set value of radio input to be org id
also don't use nil, this isn't ruby
This commit is contained in:
@@ -276,10 +276,10 @@ def service_set_branding_and_org(service_id):
|
||||
|
||||
form = ServiceBrandingOrg(branding_type=current_service.get('branding'))
|
||||
# dynamically create org choices, including the null option
|
||||
form.organisation.choices = [('nil', 'None')] + get_branding_as_value_and_label(organisations)
|
||||
form.organisation.choices = [('None', 'None')] + get_branding_as_value_and_label(organisations)
|
||||
|
||||
if form.validate_on_submit():
|
||||
organisation = None if form.organisation.data == 'nil' else form.organisation.data
|
||||
organisation = None if form.organisation.data == 'None' else form.organisation.data
|
||||
service_api_client.update_service(
|
||||
service_id,
|
||||
branding=form.branding_type.data,
|
||||
@@ -287,8 +287,8 @@ def service_set_branding_and_org(service_id):
|
||||
)
|
||||
return redirect(url_for('.service_settings', service_id=service_id))
|
||||
|
||||
# only set form.organisation.data on GET (to select correct initial radio button)
|
||||
form.organisation.data = current_service['organisation'] or 'nil'
|
||||
form.organisation.data = current_service['organisation'] or 'None'
|
||||
|
||||
return render_template(
|
||||
'views/service-settings/set-branding-and-org.html',
|
||||
form=form,
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
type="radio"
|
||||
name="{{ field.name }}"
|
||||
id="{{ field.name }}-{{ loop.index }}"
|
||||
value="{{ value }}"
|
||||
{% if checked %}checked="checked"{% endif %}
|
||||
/>
|
||||
{% if branding_dict.get(value, {}).get('colour') %}
|
||||
|
||||
Reference in New Issue
Block a user