Quellcode durchsuchen

Remove unintended filter form from child object tabs

The filter form block added to object_children.html caused a collapsible
filter panel to appear on all child object tabs (Console Ports, Power
Ports, Interfaces, etc.) for views that have filterset_form set — a much
broader change than intended. Remove the block entirely.

Also remove filterset_form from DeviceInterfacesView since the
InterfaceFilterForm is a global form with device/location-level fields
inappropriate for the device-specific interface tab; the filterset alone
is sufficient for URL-param filtering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Brian Tiemann vor 21 Stunden
Ursprung
Commit
634bc9d86b
2 geänderte Dateien mit 0 neuen und 17 gelöschten Zeilen
  1. 0 1
      netbox/dcim/views.py
  2. 0 16
      netbox/templates/generic/object_children.html

+ 0 - 1
netbox/dcim/views.py

@@ -2742,7 +2742,6 @@ class DeviceInterfacesView(DeviceComponentsView):
     child_model = Interface
     table = tables.DeviceInterfaceTable
     filterset = filtersets.InterfaceFilterSet
-    filterset_form = forms.InterfaceFilterForm
     actions = (EditObject, DeleteObject, BulkEdit, BulkRename, BulkDisconnect, BulkDelete)
     template_name = 'dcim/device/interfaces.html'
     tab = ViewTab(

+ 0 - 16
netbox/templates/generic/object_children.html

@@ -26,22 +26,6 @@ Context:
     {% block table_controls %}
         {% include 'inc/table_controls_htmx.html' with table_modal=table_config %}
     {% endblock table_controls %}
-    {% if filter_form %}
-        {% applied_filters model filter_form request.GET %}
-        <div class="mb-3 d-print-none">
-            <button class="btn btn-sm btn-outline-secondary" type="button"
-                    data-bs-toggle="collapse" data-bs-target="#filters-form"
-                    aria-expanded="{% if filter_form.changed_data %}true{% else %}false{% endif %}"
-                    aria-controls="filters-form">
-                <i class="mdi mdi-filter" aria-hidden="true"></i>
-                {% trans "Filters" %}
-                {% badge filter_form.changed_data|length bg_color="primary" %}
-            </button>
-        </div>
-        <div class="collapse {% if filter_form.changed_data %}show{% endif %}" id="filters-form">
-            {% include 'inc/filter_list.html' %}
-        </div>
-    {% endif %}
     <form method="post">
         {% csrf_token %}
         <div class="card">