Skip to content

Bulk edit of models with M2M fields can clear the M2M field #12983

@Urth

Description

@Urth

NetBox version

v3.5.4 and tested on develop

Python version

3.10

Steps to Reproduce

  1. Create an interface with one or more tagged_vlans.
  2. Use bulk edit on the interface to change something unrelated like the speed.
  3. Observe the changelog with the tagged_vlans being removed.

Expected Behavior

The untagged_vlans should remain unchanged if none are selected and set null is unchecked.

Observed Behavior

The untagged_vlans are removed from the interface.

Caused by https://github.com/netbox-community/netbox/blob/develop/netbox/netbox/views/generic/bulk_views.py#L554-L555
In 41c9248 the truthy check on the m2m queryset was removed. Django querysets evaluate to False if the queryset is empty.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions