From 598461654da0506b9b30146d14f32845fe62290a Mon Sep 17 00:00:00 2001 From: Seb Harrington Date: Fri, 3 May 2024 19:22:27 +0100 Subject: [PATCH] role should be checked against a set of roles not just one --- netbox_device_map/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox_device_map/views.py b/netbox_device_map/views.py index f6d71a7..cfb807a 100644 --- a/netbox_device_map/views.py +++ b/netbox_device_map/views.py @@ -31,7 +31,8 @@ class MapView(PermissionRequiredMixin, View): #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(role=device_roles) + devices = devices.filter(role__in=device_roles) + print(f"Device roles are :{device_roles}") geolocated_devices = {d: coords for d in devices if (coords := get_device_location(d))} non_geolocated_devices = set(devices) - set(geolocated_devices.keys())