Skip to content

Conversation

@Urth
Copy link
Contributor

@Urth Urth commented Jun 26, 2023

Fixes: #12983

Partially revert 41c9248 to restore bulk edit with m2m fields. The m2m cleaned_data yields a empty queryset when nothing is selected. By setting the m2m relation unless set null is checked even when nothing is selected the m2m relation is always cleared.

This commit only sets the m2m relation when a selection is made.

…lected

Partially revert 41c9248 to restore
bulk edit with m2m fields. The m2m cleaned_data yields a empty queryset
when nothing is selected. By setting the m2m relation unless set null is
checked even when nothing is selected the m2m relation is always
cleared.

This commit only sets the m2m relation when a selection is made.
@DanSheps DanSheps self-requested a review June 26, 2023 20:41
@jeremystretch
Copy link
Member

Thanks @Urth!

@jeremystretch jeremystretch merged commit 34d3237 into netbox-community:develop Jun 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants