[PR #21033] [MERGED] Fixes #21032: Avoid subquery in RestrictedQuerySet where unnecessary #16129

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/21033
Author: @jeremystretch
Created: 12/23/2025
Status: Merged
Merged: 12/23/2025
Merged by: @jeremystretch

Base: mainHead: 21032-RestrictedQuerySet-optimization


📝 Commits (1)

  • e536f62 Fixes #21032: Avoid subquery in RestrictedQuerySet where unnecessary

📊 Changes

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

View changed files

📝 netbox/utilities/querysets.py (+10 -10)

📄 Description

Fixes: #21032

Check whether qs_filter_from_constraints() returns a query filter. If not, skip the subquery.


🔄 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/21033 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 12/23/2025 **Status:** ✅ Merged **Merged:** 12/23/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `21032-RestrictedQuerySet-optimization` --- ### 📝 Commits (1) - [`e536f62`](https://github.com/netbox-community/netbox/commit/e536f6202aa7a4d3d197f8fbfaaf076a8f6b8a8e) Fixes #21032: Avoid subquery in RestrictedQuerySet where unnecessary ### 📊 Changes **1 file changed** (+10 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `netbox/utilities/querysets.py` (+10 -10) </details> ### 📄 Description ### Fixes: #21032 Check whether `qs_filter_from_constraints()` returns a query filter. If not, skip the subquery. --- <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:57 +01:00
adam closed this issue 2025-12-30 00:25:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16129