[PR #19102] [MERGED] Fixes #19092: scope type selection lost when editing multiple/all objects #15526

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19102
Author: @jnovinger
Created: 4/7/2025
Status: Merged
Merged: 4/9/2025
Merged by: @jeremystretch

Base: mainHead: 19092-bulk-edit-loses-scope-type-choice


📝 Commits (1)

  • c03072f Fixes #19092: scope type selection lost when editing multiple/all objects

📊 Changes

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

View changed files

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

📄 Description

Fixes: #19092

This essentially reverts the previous fix for #18964, which attempted to fix the issue with some objects not being updated when the "select all

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19102 **Author:** [@jnovinger](https://github.com/jnovinger) **Created:** 4/7/2025 **Status:** ✅ Merged **Merged:** 4/9/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `19092-bulk-edit-loses-scope-type-choice` --- ### 📝 Commits (1) - [`c03072f`](https://github.com/netbox-community/netbox/commit/c03072f45be7db43a6f7d4526b8a3758d583cae9) Fixes #19092: scope type selection lost when editing multiple/all objects ### 📊 Changes **1 file changed** (+3 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/views/generic/bulk_views.py` (+3 -5) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #19092 This essentially reverts the previous fix for #18964, which attempted to fix the issue with some objects not being updated when the "select all <n> <object type>s matching query" checkbox was marked by restoring an `else` clause that had been removed in the fix for #18194. However, doing so regressed the fix for #18194 while still leaving most of the changes for that fix in place. Rather than trying to guess all of the possible fields that might need to be stuffed in to `initial_data` across all bulk edit view/form combinations, I took the approach of making a copy of `request.POST` and over-writing the `pk` list with what ever we determined to use earlier in the `BulkEditView.post()` method. With this approach, anything that is set in the form is still transmitted to the form instance via `request.POST` but the `pk` list set in `initial_data` is instead overridden by the expected value. The end result is that all users selections on the form, as well as the object selections to edit, are preserved for the next iteration of the form. <!-- Please include a summary of the proposed changes below. --> --- <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-30 00:22:29 +01:00
adam closed this issue 2025-12-30 00:22:29 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15526