1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Don't add a placeholder option to multiselect widgets

This commit is contained in:
Jeremy Stretch
2017-09-12 14:14:08 -04:00
parent d651deb31c
commit 136d16b7fd
2 changed files with 3 additions and 2 deletions

View File

@ -77,7 +77,9 @@ $(document).ready(function() {
// Wipe out any existing options within the child field and create a default option
child_field.empty();
child_field.append($("<option></option>").attr("value", "").text("---------"));
if (!child_field.attr('multiple')) {
child_field.append($("<option></option>").attr("value", "").text("---------"));
}
if ($(this).val() || $(this).attr('nullable') == 'true') {
var api_url = child_field.attr('api-url') + '&limit=1000';

View File

@ -140,7 +140,6 @@ class ClusterAddDevicesForm(BootstrapMixin, ChainedFieldsMixin, forms.Form):
('rack', 'rack'),
),
label='Device',
required=False,
widget=APISelectMultiple(
api_url='/api/dcim/devices/?site_id={{site}}&rack_id={{rack}}',
display_field='display_name',