Skip to content

Commit

Permalink
Refine check to account scenario right after clearing ordering string
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed Jun 26, 2023
1 parent 0e92b13 commit 236dc8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion netbox/ipam/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,11 @@ def get_children(self, request, parent):
return parent.get_child_ips().restrict(request.user, 'view').prefetch_related('vrf', 'tenant', 'tenant__group')

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 (
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 queryset
Expand Down

0 comments on commit 236dc8b

Please sign in to comment.