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:
@ -77,7 +77,9 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// Wipe out any existing options within the child field and create a default option
|
// Wipe out any existing options within the child field and create a default option
|
||||||
child_field.empty();
|
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') {
|
if ($(this).val() || $(this).attr('nullable') == 'true') {
|
||||||
var api_url = child_field.attr('api-url') + '&limit=1000';
|
var api_url = child_field.attr('api-url') + '&limit=1000';
|
||||||
|
@ -140,7 +140,6 @@ class ClusterAddDevicesForm(BootstrapMixin, ChainedFieldsMixin, forms.Form):
|
|||||||
('rack', 'rack'),
|
('rack', 'rack'),
|
||||||
),
|
),
|
||||||
label='Device',
|
label='Device',
|
||||||
required=False,
|
|
||||||
widget=APISelectMultiple(
|
widget=APISelectMultiple(
|
||||||
api_url='/api/dcim/devices/?site_id={{site}}&rack_id={{rack}}',
|
api_url='/api/dcim/devices/?site_id={{site}}&rack_id={{rack}}',
|
||||||
display_field='display_name',
|
display_field='display_name',
|
||||||
|
Reference in New Issue
Block a user