diff --git a/netbox_device_map/forms.py b/netbox_device_map/forms.py index 980ea1a..2d5b9a5 100644 --- a/netbox_device_map/forms.py +++ b/netbox_device_map/forms.py @@ -15,6 +15,7 @@ class DeviceMapFilterForm(BootstrapMixin, forms.Form): ) vlan = DynamicModelChoiceField( queryset=VLAN.objects.all(), + required=False, label="VLAN", help_text="Filter devices by VLAN attached to any device interface", query_params={"group_id": "$vlan_group"} diff --git a/netbox_device_map/views.py b/netbox_device_map/views.py index 61c7b58..823bdd6 100644 --- a/netbox_device_map/views.py +++ b/netbox_device_map/views.py @@ -28,7 +28,7 @@ class MapView(PermissionRequiredMixin, View): interfaces = Interface.objects.all() vlan = form.cleaned_data['vlan'] - interfaces = interfaces.filter(Q(untagged_vlan=vlan) | Q(tagged_vlans=vlan)) + #interfaces = interfaces.filter(Q(untagged_vlan=vlan) | Q(tagged_vlans=vlan)) devices = Device.objects.filter(interfaces__in=interfaces).distinct() if device_roles := form.cleaned_data['device_roles']: devices = devices.filter(device_role__in=device_roles)