Skip to content

Commit 7a38f60

Browse files
Fixes: #11715 - Fix Parent Prefix table display (#12448)
* Fixes: #11715 - Fix Parent Prefix table display of global vrf prefixes that are **not** containers. * Combine AND into a single Q object Co-authored-by: Jeremy Stretch <[email protected]> --------- Co-authored-by: Jeremy Stretch <[email protected]>
1 parent abdcfde commit 7a38f60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

netbox/ipam/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from virtualization.filtersets import VMInterfaceFilterSet
1515
from virtualization.models import VMInterface
1616
from . import filtersets, forms, tables
17+
from .choices import PrefixStatusChoices
1718
from .constants import *
1819
from .models import *
1920
from .tables.l2vpn import L2VPNTable, L2VPNTerminationTable
@@ -495,7 +496,7 @@ def get_extra_context(self, request, instance):
495496

496497
# Parent prefixes table
497498
parent_prefixes = Prefix.objects.restrict(request.user, 'view').filter(
498-
Q(vrf=instance.vrf) | Q(vrf__isnull=True)
499+
Q(vrf=instance.vrf) | Q(vrf__isnull=True, status=PrefixStatusChoices.STATUS_CONTAINER)
499500
).filter(
500501
prefix__net_contains=str(instance.prefix)
501502
).prefetch_related(

0 commit comments

Comments
 (0)