Skip to content

Commit

Permalink
Update some detail views with prefetch_related from 'site' to 'scope'
Browse files Browse the repository at this point in the history
  • Loading branch information
bctiemann authored and jeremystretch committed Jan 6, 2025
1 parent c3b0de3 commit 89d7487
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions netbox/ipam/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def get_extra_context(self, request, instance):
Q(prefix__net_contains_or_equals=str(instance.end_address.ip)),
vrf=instance.vrf
).prefetch_related(
'site', 'role', 'tenant', 'vlan', 'role'
'scope', 'role', 'tenant', 'vlan', 'role'
)
parent_prefixes_table = tables.PrefixTable(
list(parent_prefixes),
Expand Down Expand Up @@ -805,7 +805,7 @@ def get_extra_context(self, request, instance):
vrf=instance.vrf,
prefix__net_contains_or_equals=str(instance.address.ip)
).prefetch_related(
'site', 'role'
'scope', 'role'
)
parent_prefixes_table = tables.PrefixTable(
list(parent_prefixes),
Expand Down Expand Up @@ -1288,7 +1288,7 @@ class VLANView(generic.ObjectView):

def get_extra_context(self, request, instance):
prefixes = Prefix.objects.restrict(request.user, 'view').filter(vlan=instance).prefetch_related(
'vrf', 'site', 'role', 'tenant'
'vrf', 'scope', 'role', 'tenant'
)
prefix_table = tables.PrefixTable(list(prefixes), exclude=('vlan', 'utilization'), orderable=False)

Expand Down

0 comments on commit 89d7487

Please sign in to comment.