diff --git a/netbox/ipam/models/vlans.py b/netbox/ipam/models/vlans.py index 8562217a21..a5e06bc290 100644 --- a/netbox/ipam/models/vlans.py +++ b/netbox/ipam/models/vlans.py @@ -118,9 +118,9 @@ def get_available_vids(self): """ Return all available VLANs within this group. """ - available_vlans = {} + available_vlans = set() for vlan_range in self.vid_ranges: - available_vlans = {vid for vid in range(vlan_range.lower, vlan_range.upper)} + available_vlans = available_vlans.union({vid for vid in range(vlan_range.lower, vlan_range.upper)}) available_vlans -= set(VLAN.objects.filter(group=self).values_list('vid', flat=True)) return sorted(available_vlans)