[PR #20956] [MERGED] #20875 fix updating of denormalized fields (_site, _location, _rack) for component models #16100

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20956
Author: @arthanson
Created: 12/10/2025
Status: Merged
Merged: 12/12/2025
Merged by: @jnovinger

Base: mainHead: 20875-device-components


📝 Commits (5)

  • 85ca55e #20875 fix updating of denormalized fields (_site, _location, _rack) for all component models
  • 451ea1d Merge branch 'main' into 20875-device-components
  • 7ad3e9d remove common function for update
  • e47eea9 cleanup
  • 425f4ce cleanup

📊 Changes

3 files changed (+20 additions, -0 deletions)

View changed files

📝 netbox/dcim/models/devices.py (+5 -0)
📝 netbox/dcim/models/modules.py (+6 -0)
📝 netbox/dcim/signals.py (+9 -0)

📄 Description

Fixes: #20875

Several cases were previously missed:

  • netbox/dcim/models/devices.py - when components are instantiated from the device-template and the denormalized fields were never getting updated.
  • netbox/dcim/models/modules.py - when creating a module and instantiating components
  • netbox/dcim/signals.py - when changing the site for a location, when changing the site for a rack

Also checked the API and it looks like the API and this should also affect those. Bulk updates on the API do serializer.save() on each object which will cause the signal handler to run.


🔄 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/20956 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 12/10/2025 **Status:** ✅ Merged **Merged:** 12/12/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `main` ← **Head:** `20875-device-components` --- ### 📝 Commits (5) - [`85ca55e`](https://github.com/netbox-community/netbox/commit/85ca55e9e7a1e0f52a4e0dc9aa5131e2574a9ee9) #20875 fix updating of denormalized fields (_site, _location, _rack) for all component models - [`451ea1d`](https://github.com/netbox-community/netbox/commit/451ea1dbfb17ba4b43ffd80033a08e2a7a98210d) Merge branch 'main' into 20875-device-components - [`7ad3e9d`](https://github.com/netbox-community/netbox/commit/7ad3e9daf385a269d43c120970ff648a7935c66e) remove common function for update - [`e47eea9`](https://github.com/netbox-community/netbox/commit/e47eea9bf4920ef87c1c4f775d54f7f5d364f36e) cleanup - [`425f4ce`](https://github.com/netbox-community/netbox/commit/425f4cee63ff2642ddf6d732a99242a6c01a6e97) cleanup ### 📊 Changes **3 files changed** (+20 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/devices.py` (+5 -0) 📝 `netbox/dcim/models/modules.py` (+6 -0) 📝 `netbox/dcim/signals.py` (+9 -0) </details> ### 📄 Description ### Fixes: #20875 Several cases were previously missed: * netbox/dcim/models/devices.py - when components are instantiated from the device-template and the denormalized fields were never getting updated. * netbox/dcim/models/modules.py - when creating a module and instantiating components * netbox/dcim/signals.py - when changing the site for a location, when changing the site for a rack Also checked the API and it looks like the API and this should also affect those. Bulk updates on the API do serializer.save() on each object which will cause the signal handler to run. --- <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:25:47 +01:00
adam closed this issue 2025-12-30 00:25:47 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16100