Просмотр исходного кода

Fixes #9328: Hide available IPs when non-default ordering is applied

jeremystretch 3 лет назад
Родитель
Сommit
899b61264f
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 0
      docs/release-notes/version-3.3.md
  2. 1 2
      netbox/ipam/views.py

+ 1 - 0
docs/release-notes/version-3.3.md

@@ -11,6 +11,7 @@
 
 ### Bug Fixes
 
+* [#9328](https://github.com/netbox-community/netbox/issues/9328) - Hide available IPs when non-default ordering is applied
 * [#9895](https://github.com/netbox-community/netbox/issues/9895) - Various corrections to OpenAPI spec
 * [#9962](https://github.com/netbox-community/netbox/issues/9962) - SSO login should respect `next` URL query parameter
 * [#9963](https://github.com/netbox-community/netbox/issues/9963) - Fix support for custom `CSRF_COOKIE_NAME` value

+ 1 - 2
netbox/ipam/views.py

@@ -526,9 +526,8 @@ class PrefixIPAddressesView(generic.ObjectChildrenView):
         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'):
+        if not request.GET.get('q') and not request.GET.get('sort'):
             return add_available_ipaddresses(parent.prefix, queryset, parent.is_pool)
-
         return queryset
 
     def get_extra_context(self, request, instance):