mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-13 16:47:34 -06:00
Fixes #5: Expand prefix hierarchy when searching for a prefix
This commit is contained in:
parent
8baa7ee410
commit
f0f3435792
@ -329,8 +329,8 @@ class PrefixListView(ObjectListView):
|
||||
template_name = 'ipam/prefix_list.html'
|
||||
|
||||
def alter_queryset(self, request):
|
||||
# Show only top-level prefixes by default
|
||||
limit = None if request.GET.get('expand') else 0
|
||||
# Show only top-level prefixes by default (unless searching)
|
||||
limit = None if request.GET.get('expand') or request.GET.get('q') else 0
|
||||
return self.queryset.annotate_depth(limit=limit)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user