Skip to content

Commit

Permalink
Fixes: #17360 - Ensure model is defined when rendering bulk_edit_butt…
Browse files Browse the repository at this point in the history
…on (#17535)

* Ensure model is defined when rendering bulk_edit_button

* Move model check to inner conditional

* Set model in context

* Return child_model instead of model for use in bulk_edit_button
  • Loading branch information
bctiemann authored Sep 26, 2024
1 parent 52a0b45 commit e93719e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions netbox/netbox/views/generic/object_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ def get(self, request, *args, **kwargs):
return render(request, 'htmx/table.html', {
'object': instance,
'table': table,
'model': self.child_model,
})

return render(request, self.get_template_name(), {
'object': instance,
'model': self.child_model,
'child_model': self.child_model,
'base_template': f'{instance._meta.app_label}/{instance._meta.model_name}.html',
'table': table,
Expand Down

0 comments on commit e93719e

Please sign in to comment.