[PR #20291] [MERGED] Fixes #20272: Inherit ConfigContext from ancestors locations #15878

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20291
Author: @pheus
Created: 9/7/2025
Status: Merged
Merged: 9/10/2025
Merged by: @arthanson

Base: mainHead: 20272-add-parent-location-evaluation-to-config-context


📝 Commits (1)

  • 490d7a1 fix(extras): Inherit ConfigContext from ancestors locations

📊 Changes

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

View changed files

📝 netbox/extras/querysets.py (+12 -3)

📄 Description

Fixes: #20272

Make ConfigContext on a parent Location apply to devices in its child Locations.

  • Aligns Locations with regions/site groups/roles.
  • Updates querysets to include ancestor Locations
    (get_ancestors(include_self=True) and an MPTT-based join for devices).
  • No schema or API changes.

Before: Context on Location A didn’t apply to a device in child Location B.
After: It does.


🔄 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/20291 **Author:** [@pheus](https://github.com/pheus) **Created:** 9/7/2025 **Status:** ✅ Merged **Merged:** 9/10/2025 **Merged by:** [@arthanson](https://github.com/arthanson) **Base:** `main` ← **Head:** `20272-add-parent-location-evaluation-to-config-context` --- ### 📝 Commits (1) - [`490d7a1`](https://github.com/netbox-community/netbox/commit/490d7a1f325e6d2e7775309aff32bada1af66d9a) fix(extras): Inherit ConfigContext from ancestors locations ### 📊 Changes **1 file changed** (+12 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/querysets.py` (+12 -3) </details> ### 📄 Description ### Fixes: #20272 Make `ConfigContext` on a **parent Location** apply to devices in its **child Locations**. - Aligns Locations with regions/site groups/roles. - Updates querysets to include ancestor Locations (`get_ancestors(include_self=True)` and an MPTT-based join for devices). - No schema or API changes. **Before:** Context on Location A didn’t apply to a device in child Location B. **After:** It does. --- <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:24:33 +01:00
adam closed this issue 2025-12-30 00:24:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15878