Преглед изворни кода

Fixes #6369: Fix interface assignment for VLANs in non-scoped groups

jeremystretch пре 4 година
родитељ
комит
2d4ae38a09
2 измењених фајлова са 3 додато и 0 уклоњено
  1. 1 0
      docs/release-notes/version-2.11.md
  2. 2 0
      netbox/ipam/querysets.py

+ 1 - 0
docs/release-notes/version-2.11.md

@@ -22,6 +22,7 @@
 * [#6355](https://github.com/netbox-community/netbox/issues/6355) - Fix caching error when swapping A/Z circuit terminations
 * [#6357](https://github.com/netbox-community/netbox/issues/6357) - Fix ProviderNetwork nested API serializer
 * [#6363](https://github.com/netbox-community/netbox/issues/6363) - Correct pre-population of cluster group when creating a cluster
+* [#6369](https://github.com/netbox-community/netbox/issues/6369) - Fix interface assignment for VLANs in non-scoped groups
 
 ---
 

+ 2 - 0
netbox/ipam/querysets.py

@@ -64,6 +64,7 @@ class VLANQuerySet(RestrictedQuerySet):
         return self.filter(
             Q(group__in=VLANGroup.objects.filter(q)) |
             Q(site=device.site) |
+            Q(group__scope_id__isnull=True, site__isnull=True) |  # Global group VLANs
             Q(group__isnull=True, site__isnull=True)  # Global VLANs
         )
 
@@ -104,6 +105,7 @@ class VLANQuerySet(RestrictedQuerySet):
         # Return all applicable VLANs
         q = (
             Q(group__in=vlan_groups) |
+            Q(group__scope_id__isnull=True, site__isnull=True) |  # Global group VLANs
             Q(group__isnull=True, site__isnull=True)  # Global VLANs
         )
         if vm.cluster.site: