[PR #13004] [MERGED] Fix #12983 bulk edit of M2M fields when nothing is selected #14092

Closed
opened 2025-12-29 23:22:27 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13004
Author: @Urth
Created: 6/26/2023
Status: Merged
Merged: 6/27/2023
Merged by: @jeremystretch

Base: developHead: issue-12983


📝 Commits (1)

  • 5c21555 Fix #12983 bulk edit of M2M fields when nothing is selected

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 netbox/netbox/views/generic/bulk_views.py (+1 -1)

📄 Description

Fixes: #12983

Partially revert 41c92483a0 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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/13004 **Author:** [@Urth](https://github.com/Urth) **Created:** 6/26/2023 **Status:** ✅ Merged **Merged:** 6/27/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `issue-12983` --- ### 📝 Commits (1) - [`5c21555`](https://github.com/netbox-community/netbox/commit/5c21555aa504f97060ec3e2d30f9f758782a4dbe) Fix #12983 bulk edit of M2M fields when nothing is selected ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/views/generic/bulk_views.py` (+1 -1) </details> ### 📄 Description ### Fixes: #12983 Partially revert 41c92483a0b9b820dd0ca0c43c6c6d6e560043ed 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:22:27 +01:00
adam closed this issue 2025-12-29 23:22:27 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14092