mirror of
https://github.com/drygdryg/netbox-plugin-device-map.git
synced 2024-11-26 20:20:54 +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))
|
#interfaces = interfaces.filter(Q(untagged_vlan=vlan) | Q(tagged_vlans=vlan))
|
||||||
devices = Device.objects.filter(interfaces__in=interfaces).distinct()
|
devices = Device.objects.filter(interfaces__in=interfaces).distinct()
|
||||||
if device_roles := form.cleaned_data['device_roles']:
|
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))}
|
geolocated_devices = {d: coords for d in devices if (coords := get_device_location(d))}
|
||||||
non_geolocated_devices = set(devices) - set(geolocated_devices.keys())
|
non_geolocated_devices = set(devices) - set(geolocated_devices.keys())
|
||||||
|
Loading…
Reference in New Issue
Block a user