diff --git a/netbox/dcim/forms/bulk_edit.py b/netbox/dcim/forms/bulk_edit.py index 6ed483c7936..92f952de216 100644 --- a/netbox/dcim/forms/bulk_edit.py +++ b/netbox/dcim/forms/bulk_edit.py @@ -1292,8 +1292,9 @@ def __init__(self, *args, **kwargs): break if site is not None: - self.fields['untagged_vlan'].widget.add_query_param('site_id', site.pk) - self.fields['tagged_vlans'].widget.add_query_param('site_id', site.pk) + # Query for VLANs assigned to the same site and VLANs with no site assigned (null). + self.fields['untagged_vlan'].widget.add_query_param('site_id', [site.pk, 'null']) + self.fields['tagged_vlans'].widget.add_query_param('site_id', [site.pk, 'null']) self.fields['parent'].choices = () self.fields['parent'].widget.attrs['disabled'] = True