Skip to content

Commit fa8f2ac

Browse files
committed
Add disable_htmx property on ObjectChildrenView to allow IP assignment flow to avoid htmx fragmentary rendering on object save
1 parent 37c9ed2 commit fa8f2ac

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

netbox/dcim/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,6 +1971,7 @@ class DeviceInterfacesView(DeviceComponentsView):
19711971
filterset = filtersets.InterfaceFilterSet
19721972
filterset_form = forms.InterfaceFilterForm
19731973
template_name = 'dcim/device/interfaces.html'
1974+
disable_htmx = True
19741975
tab = ViewTab(
19751976
label=_('Interfaces'),
19761977
badge=lambda obj: obj.vc_interfaces().count(),

netbox/netbox/views/generic/object_views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ class ObjectChildrenView(ObjectView, ActionsMixin, TableMixin):
9696
filterset = None
9797
filterset_form = None
9898
template_name = 'generic/object_children.html'
99+
# Currently used only to work around the singular behavior of the IP assignment flow in DeviceInterfacesView
100+
disable_htmx = False
99101

100102
def get_children(self, request, parent):
101103
"""
@@ -142,7 +144,7 @@ def get(self, request, *args, **kwargs):
142144
table = self.get_table(table_data, request, has_bulk_actions)
143145

144146
# If this is an HTMX request, return only the rendered table HTML
145-
if htmx_partial(request):
147+
if htmx_partial(request) and not self.disable_htmx:
146148
return render(request, 'htmx/table.html', {
147149
'object': instance,
148150
'table': table,

0 commit comments

Comments
 (0)