[PR #19310] [MERGED] Fixes #15971: Preserve 'none' selection in filter form fields #15605

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19310
Author: @jeremystretch
Created: 4/24/2025
Status: Merged
Merged: 4/28/2025
Merged by: @bctiemann

Base: mainHead: 15971-preserve-null-filter


📝 Commits (1)

  • 47da880 Fixes #15971: Preserve 'none' selection in filter form fields

📊 Changes

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

View changed files

📝 netbox/utilities/forms/fields/dynamic.py (+8 -1)

📄 Description

Fixes: #15971

If null_option set on the field, convert its choices attribute from ModelChoiceIterator to a list and insert the null option. This allows it to be displayed as a selected choice when the widget is rendered.


🔄 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/19310 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 4/24/2025 **Status:** ✅ Merged **Merged:** 4/28/2025 **Merged by:** [@bctiemann](https://github.com/bctiemann) **Base:** `main` ← **Head:** `15971-preserve-null-filter` --- ### 📝 Commits (1) - [`47da880`](https://github.com/netbox-community/netbox/commit/47da8805478073854bb7e41ec011614f8a78b358) Fixes #15971: Preserve 'none' selection in filter form fields ### 📊 Changes **1 file changed** (+8 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/utilities/forms/fields/dynamic.py` (+8 -1) </details> ### 📄 Description ### Fixes: #15971 If `null_option` set on the field, convert its `choices` attribute from ModelChoiceIterator to a list and insert the null option. This allows it to be displayed as a selected choice when the widget is rendered. --- <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:22:58 +01:00
adam closed this issue 2025-12-30 00:22:58 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15605