Bulk edit/delete displayed even if not supported #11802

Closed
opened 2025-12-29 21:50:01 +01:00 by adam · 1 comment
Owner

Originally created by @alehaa on GitHub (Nov 2, 2025).

NetBox Edition

NetBox Community

NetBox Version

v4.4.5

Python Version

3.12

Steps to Reproduce

  1. Comment out Device bulk_edit registration:
    # @register_model_view(Device, 'bulk_edit', path='edit', detail=False)
    class DeviceBulkEditView(generic.BulkEditView):
    
  2. Restart NetBox
  3. Visit Device list view

Note: While users wouldn’t modify NetBox code, this illustrates a plugin’s without support for bulk operations.

Expected Behavior

If no bulk views are registered, the related buttons (edit and delete) should be hidden.

Observed Behavior

The buttons are displayed, but they lead users to an error 404.

Originally created by @alehaa on GitHub (Nov 2, 2025). ### NetBox Edition NetBox Community ### NetBox Version v4.4.5 ### Python Version 3.12 ### Steps to Reproduce 1. Comment out `Device` `bulk_edit` registration: ```Python # @register_model_view(Device, 'bulk_edit', path='edit', detail=False) class DeviceBulkEditView(generic.BulkEditView): ``` 2. Restart NetBox 3. Visit Device list view Note: While users wouldn’t modify NetBox code, this illustrates a plugin’s without support for bulk operations. ### Expected Behavior If no bulk views are registered, the related buttons (edit and delete) should be hidden. ### Observed Behavior The buttons are displayed, but they lead users to an error 404.
adam added the netbox label 2025-12-29 21:50:01 +01:00
adam closed this issue 2025-12-29 21:50:01 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 3, 2025):

View registration has no impact on this. Support for bulk operations is inferred from the actions defined for a view. As a plugin author, you are responsible for defining the set of supported actions on a view should they differ from the default. For example:

@register_model_view(RackReservation, 'list', path='', detail=False)
class RackReservationListView(generic.ObjectListView):
    actions = (AddObject, BulkImport, BulkExport, BulkEdit, BulkDelete)

See the ActionsMixin class for further details.

@jeremystretch commented on GitHub (Nov 3, 2025): View registration has no impact on this. Support for bulk operations is inferred from the actions defined for a view. As a plugin author, you are responsible for defining the set of supported actions on a view should they differ from the default. For example: ```python @register_model_view(RackReservation, 'list', path='', detail=False) class RackReservationListView(generic.ObjectListView): actions = (AddObject, BulkImport, BulkExport, BulkEdit, BulkDelete) ``` See the [`ActionsMixin` class](https://github.com/netbox-community/netbox/blob/cbf9b62f12485a235c1bf6a233857203ccc30986/netbox/netbox/views/generic/mixins.py#L25) for further details.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11802