[PR #11784] [MERGED] Fixes #11539: Use BooleanFilter for 'empty' lookups #13841

Closed
opened 2025-12-29 23:21:07 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/11784
Author: @jeremystretch
Created: 2/17/2023
Status: Merged
Merged: 5/25/2023
Merged by: @jeremystretch

Base: developHead: 11539-empty-lookups


📝 Commits (3)

  • 93a80c6 Use BooleanFilter for 'empty' lookups
  • f632a53 Always use BooleanFilter for 'empty' lookups
  • ada6ab0 Restore Empty lookup logic

📊 Changes

2 files changed (+17 additions, -6 deletions)

View changed files

📝 netbox/extras/lookups.py (+7 -5)
📝 netbox/netbox/filtersets.py (+10 -1)

📄 Description

Fixes: #11539

  • Clean up our custom Empty lookup to more accurately evaluate true/false conditions
  • Force the use of BooleanFilter for empty lookups in requests

While this seems to address the bug for most fields, I still need to figure out how to correct the filter class for declared filters, such DeviceFilterSet.name (which is the actual target of the bug report).


🔄 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/11784 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 2/17/2023 **Status:** ✅ Merged **Merged:** 5/25/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `11539-empty-lookups` --- ### 📝 Commits (3) - [`93a80c6`](https://github.com/netbox-community/netbox/commit/93a80c6580cdafce2f71aac386e91ae511f9dd9e) Use BooleanFilter for 'empty' lookups - [`f632a53`](https://github.com/netbox-community/netbox/commit/f632a536d438e2679816c258e7afb34e1283e077) Always use BooleanFilter for 'empty' lookups - [`ada6ab0`](https://github.com/netbox-community/netbox/commit/ada6ab0b85e2caaa950128ba6751aa1f8abbc26c) Restore Empty lookup logic ### 📊 Changes **2 files changed** (+17 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/lookups.py` (+7 -5) 📝 `netbox/netbox/filtersets.py` (+10 -1) </details> ### 📄 Description ### Fixes: #11539 - Clean up our custom `Empty` lookup to more accurately evaluate true/false conditions - Force the use of BooleanFilter for `empty` lookups in requests While this seems to address the bug for _most_ fields, I still need to figure out how to correct the filter class for declared filters, such `DeviceFilterSet.name` (which is the actual target of the bug report). --- <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 23:21:07 +01:00
adam closed this issue 2025-12-29 23:21:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13841