Skip to content

Commit

Permalink
Fixes #15778: Fix bulk edit/delete functionality when HTMX is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Apr 22, 2024
1 parent 46bd62f commit e3c4182
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions netbox/utilities/templatetags/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def export_button(context, model):
}


@register.inclusion_tag('buttons/bulk_edit.html')
def bulk_edit_button(model, action='bulk_edit', query_params=None):
@register.inclusion_tag('buttons/bulk_edit.html', takes_context=True)
def bulk_edit_button(context, model, action='bulk_edit', query_params=None):
try:
url = reverse(get_viewname(model, action))
if query_params:
Expand All @@ -162,12 +162,13 @@ def bulk_edit_button(model, action='bulk_edit', query_params=None):
url = None

return {
'htmx_navigation': context.get('htmx_navigation'),
'url': url,
}


@register.inclusion_tag('buttons/bulk_delete.html')
def bulk_delete_button(model, action='bulk_delete', query_params=None):
@register.inclusion_tag('buttons/bulk_delete.html', takes_context=True)
def bulk_delete_button(context, model, action='bulk_delete', query_params=None):
try:
url = reverse(get_viewname(model, action))
if query_params:
Expand All @@ -176,5 +177,6 @@ def bulk_delete_button(model, action='bulk_delete', query_params=None):
url = None

return {
'htmx_navigation': context.get('htmx_navigation'),
'url': url,
}

0 comments on commit e3c4182

Please sign in to comment.