[PR #3823] [CLOSED] Fixes #3822: device bay edit #12651

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/3823
Author: @hSaria
Created: 1/2/2020
Status: Closed

Base: developHead: 3822-device-bay-edit


📝 Commits (4)

  • 2bef69c Fixes 3822: Missing field in form
  • bf65452 Allow the DeviceBay to be updated if current_bay is self
  • a373ce9 3822 changelog
  • 0a12407 Corrected current_bay condition

📊 Changes

3 files changed (+4 additions, -2 deletions)

View changed files

📝 docs/release-notes/version-2.6.md (+1 -0)
📝 netbox/dcim/forms.py (+2 -1)
📝 netbox/dcim/models.py (+1 -1)

📄 Description

Fixes: #3822

The edit form for the device bay was missing installed_device as a hidden input field.

When fixing the above issue, I noticed that there was a logic issue in the model of DeviceBay in that it did not allow updates once created and a device is installed because of the current_bay of the installed device condition. This was fixed by allowing the update to go through if the current_bay is the bay to be updated, or, stated differently, fail if current_bay is not the bay to be updated.

You could also exclude self from the query for current_bay. Not sure which is the better approach.


🔄 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/3823 **Author:** [@hSaria](https://github.com/hSaria) **Created:** 1/2/2020 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `3822-device-bay-edit` --- ### 📝 Commits (4) - [`2bef69c`](https://github.com/netbox-community/netbox/commit/2bef69cc02d1e0e4ad6f4dcb81fc8b65d823513b) Fixes 3822: Missing field in form - [`bf65452`](https://github.com/netbox-community/netbox/commit/bf654526c72526bf0f0107d6c6d8f9f7f579bc60) Allow the DeviceBay to be updated if current_bay is self - [`a373ce9`](https://github.com/netbox-community/netbox/commit/a373ce9f66a47317926a0bb2ba22571a6b1e08d0) 3822 changelog - [`0a12407`](https://github.com/netbox-community/netbox/commit/0a124073ea2c6c20d86ab77a8c2e3de71517fbd4) Corrected current_bay condition ### 📊 Changes **3 files changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/release-notes/version-2.6.md` (+1 -0) 📝 `netbox/dcim/forms.py` (+2 -1) 📝 `netbox/dcim/models.py` (+1 -1) </details> ### 📄 Description ### Fixes: #3822 The edit form for the device bay was missing `installed_device` as a hidden input field. When fixing the above issue, I noticed that there was a logic issue in the model of `DeviceBay` in that it did not allow updates once created and a device is installed because of the `current_bay` of the installed device condition. This was fixed by allowing the update to go through if the current_bay is the bay to be updated, or, stated differently, fail if current_bay is not the bay to be updated. > You could also exclude `self` from the query for `current_bay`. Not sure which is the better approach. --- <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 22:22:51 +01:00
adam closed this issue 2025-12-29 22:22:52 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12651