[PR #17574] [MERGED] Closes: #16837 - Fix type__empty filter in character-based filters #15123

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17574
Author: @bctiemann
Created: 9/23/2024
Status: Merged
Merged: 9/24/2024
Merged by: @jeremystretch

Base: developHead: 16837-filter-cable-type__empty-only


📝 Commits (2)

  • 3f691b4 Fix type__empty filter in character-based filters
  • 30855fb Add tests

📊 Changes

2 files changed (+9 additions, -2 deletions)

View changed files

📝 netbox/dcim/tests/test_filtersets.py (+4 -0)
📝 netbox/netbox/filtersets.py (+5 -2)

📄 Description

Fixes: #16837

Removes choices and null_value params from the extra dict on a filterset field definition during get_additional_lookups, which allows the stock filter to be inited properly, meaning we no longer need to short-circuit the set of additional lookups to enable for filters such as MultipleChoiceFilter and limit them only to FILTER_NEGATION_LOOKUP_MAP if a choices param is present.


🔄 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/17574 **Author:** [@bctiemann](https://github.com/bctiemann) **Created:** 9/23/2024 **Status:** ✅ Merged **Merged:** 9/24/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `16837-filter-cable-type__empty-only` --- ### 📝 Commits (2) - [`3f691b4`](https://github.com/netbox-community/netbox/commit/3f691b4d920e43f5be175f4d0e4f4dc920a658ed) Fix type__empty filter in character-based filters - [`30855fb`](https://github.com/netbox-community/netbox/commit/30855fb2d2cbbb54966618d4d163cc9388894baa) Add tests ### 📊 Changes **2 files changed** (+9 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/tests/test_filtersets.py` (+4 -0) 📝 `netbox/netbox/filtersets.py` (+5 -2) </details> ### 📄 Description Fixes: #16837 Removes `choices` and `null_value` params from the `extra` dict on a filterset field definition during `get_additional_lookups`, which allows the stock filter to be inited properly, meaning we no longer need to short-circuit the set of additional lookups to enable for filters such as `MultipleChoiceFilter` and limit them only to `FILTER_NEGATION_LOOKUP_MAP` if a `choices` param is present. --- <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:20:08 +01:00
adam closed this issue 2025-12-30 00:20:08 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15123