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

Fixes #9663: Omit available IP annotations when filtering prefix child IPs list

jeremystretch 3 лет назад
Родитель
Сommit
5f37699736
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

@@ -15,6 +15,7 @@
 
 
 ### Bug Fixes
 ### Bug Fixes
 
 
+* [#9663](https://github.com/netbox-community/netbox/issues/9663) - Omit available IP annotations when filtering prefix child IPs list
 * [#10040](https://github.com/netbox-community/netbox/issues/10040) - Fix exception when ordering prefixes by flat representation
 * [#10040](https://github.com/netbox-community/netbox/issues/10040) - Fix exception when ordering prefixes by flat representation
 * [#10053](https://github.com/netbox-community/netbox/issues/10053) - Custom fields header should not be displayed when editing circuit terminations with no custom fields
 * [#10053](https://github.com/netbox-community/netbox/issues/10053) - Custom fields header should not be displayed when editing circuit terminations with no custom fields
 * [#10055](https://github.com/netbox-community/netbox/issues/10055) - Fix extraneous NAT indicator by device primary IP
 * [#10055](https://github.com/netbox-community/netbox/issues/10055) - Fix extraneous NAT indicator by device primary IP

+ 1 - 2
netbox/ipam/views.py

@@ -526,8 +526,7 @@ 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):
-        show_available = bool(request.GET.get('show_available', 'true') == 'true')
-        if show_available:
+        if not request.GET.get('q'):
             return add_available_ipaddresses(parent.prefix, queryset, parent.is_pool)
             return add_available_ipaddresses(parent.prefix, queryset, parent.is_pool)
 
 
         return queryset
         return queryset