Skip to content

Commit

Permalink
Fixes #11209 - Do not add available ips when IPAddressTable sort pref…
Browse files Browse the repository at this point in the history
…erences are saved
  • Loading branch information
DanSheps committed Jun 6, 2023
1 parent 4a88d5e commit 9e435ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion netbox/ipam/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,9 @@ 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):
if not request.GET.get('q') and not request.GET.get('sort'):
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')
):
return add_available_ipaddresses(parent.prefix, queryset, parent.is_pool)
return queryset

Expand Down

0 comments on commit 9e435ee

Please sign in to comment.