mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
Fixes #15310 - Ability to choose VLAN group span over multiple sites in VM
This commit is contained in:
parent
8f5d273f08
commit
fe3bf8ee5e
@ -160,6 +160,11 @@ class VLANQuerySet(RestrictedQuerySet):
|
|||||||
scope_type=ContentType.objects.get_by_natural_key('virtualization', 'clustergroup'),
|
scope_type=ContentType.objects.get_by_natural_key('virtualization', 'clustergroup'),
|
||||||
scope_id=vm.cluster.group_id
|
scope_id=vm.cluster.group_id
|
||||||
)
|
)
|
||||||
|
if vm.cluster._site_group:
|
||||||
|
q |= Q(
|
||||||
|
scope_type=ContentType.objects.get_by_natural_key('dcim', 'sitegroup'),
|
||||||
|
scope_id__in=vm.cluster._site_group.get_ancestors(include_self=True)
|
||||||
|
)+ if vm.cluster._site_group:
|
||||||
if site:
|
if site:
|
||||||
# Add VLANGroups scoped to the assigned site (or its group or region)
|
# Add VLANGroups scoped to the assigned site (or its group or region)
|
||||||
q |= Q(
|
q |= Q(
|
||||||
|
Loading…
Reference in New Issue
Block a user