[PR #18298] [MERGED] Fixes: #18288 - Fix prefetch_related incorrectly looking for "site" on scoped models #15314

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/18298
Author: @bctiemann
Created: 1/3/2025
Status: Merged
Merged: 1/6/2025
Merged by: @jeremystretch

Base: featureHead: 18288-fix-scope-prefetch_related


📝 Commits (1)

  • 9c4b97d Update some detail views with prefetch_related from 'site' to 'scope'

📊 Changes

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

View changed files

📝 netbox/ipam/views.py (+3 -3)

📄 Description

Fixes: #18288

At least three detail views in ipam/views.py are using prefetch_related on the site field, which no longer is compatible with that pattern after changing to generic scopes. This change updates those prefetched fields to scope.


🔄 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/18298 **Author:** [@bctiemann](https://github.com/bctiemann) **Created:** 1/3/2025 **Status:** ✅ Merged **Merged:** 1/6/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `18288-fix-scope-prefetch_related` --- ### 📝 Commits (1) - [`9c4b97d`](https://github.com/netbox-community/netbox/commit/9c4b97d32982bcce1d6e5ec6c1cafa72947e7a37) Update some detail views with prefetch_related from 'site' to 'scope' ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `netbox/ipam/views.py` (+3 -3) </details> ### 📄 Description ### Fixes: #18288 At least three detail views in `ipam/views.py` are using `prefetch_related` on the `site` field, which no longer is compatible with that pattern after changing to generic scopes. This change updates those prefetched fields to `scope`. --- <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:21:13 +01:00
adam closed this issue 2025-12-30 00:21:13 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15314