Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion netbox/netbox/views/generic/bulk_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ def export_template(self, template, request):
query_params.pop('export')
return redirect(f'{request.path}?{query_params.urlencode()}')

def _is_embedded_path(self, request):
if 'return_url' in request.GET:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't rely on return_url as an indicator for the nature of the request.

if request.GET['return_url'] != request.path:
return True

return False

#
# Request handlers
#
Expand Down Expand Up @@ -163,7 +170,7 @@ def get(self, request):

# If this is an HTMX request, return only the rendered table HTML
if htmx_partial(request):
if not request.htmx.target:
if not request.htmx.target and self._is_embedded_path(request):
table.embedded = True
# Hide selection checkboxes
if 'pk' in table.base_columns:
Expand Down