mirror of
https://github.com/drygdryg/netbox-plugin-device-map.git
synced 2024-11-29 21:50:53 +03:00
role should be checked against a set of roles not just one
This commit is contained in:
parent
974870adeb
commit
598461654d
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user