mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 08:25:17 -06:00
Refine check to account scenario right after clearing ordering string
This commit is contained in:
parent
42428c4e05
commit
16c253b2da
@ -606,8 +606,11 @@ class PrefixIPAddressesView(generic.ObjectChildrenView):
|
|||||||
return parent.get_child_ips().restrict(request.user, 'view').prefetch_related('vrf', 'tenant', 'tenant__group')
|
return parent.get_child_ips().restrict(request.user, 'view').prefetch_related('vrf', 'tenant', 'tenant__group')
|
||||||
|
|
||||||
def prep_table_data(self, request, queryset, parent):
|
def prep_table_data(self, request, queryset, parent):
|
||||||
|
# Check for presence of a q string, an ordering string, or user preferences ordering and the ordering string
|
||||||
|
# is blank
|
||||||
if not request.GET.get('q') and not request.GET.get('sort') and not (
|
if not request.GET.get('q') and not request.GET.get('sort') and not (
|
||||||
request.user.is_authenticated and request.user.config.get(f'tables.IPAddressTable.ordering')
|
request.user.is_authenticated and request.user.config.get(f'tables.IPAddressTable.ordering') and
|
||||||
|
not request.GET.get('sort') == ''
|
||||||
):
|
):
|
||||||
return add_available_ipaddresses(parent.prefix, queryset, parent.is_pool)
|
return add_available_ipaddresses(parent.prefix, queryset, parent.is_pool)
|
||||||
return queryset
|
return queryset
|
||||||
|
Loading…
Reference in New Issue
Block a user