[PR #4133] [MERGED] Fixes #4083: Permit nullifying applicable choice fields via API requests #12766

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4133
Author: @jeremystretch
Created: 2/10/2020
Status: Merged
Merged: 2/10/2020
Merged by: @jeremystretch

Base: developHead: 4083-serializer-null-choices


📝 Commits (1)

  • 7388fa3 Fixes #4083: Permit nullifying applicable choice fields via API requests

📊 Changes

5 files changed (+41 additions, -15 deletions)

View changed files

📝 docs/release-notes/version-2.7.md (+1 -0)
📝 netbox/dcim/api/serializers.py (+18 -10)
📝 netbox/ipam/api/serializers.py (+2 -2)
📝 netbox/utilities/api.py (+19 -2)
📝 netbox/virtualization/api/serializers.py (+1 -1)

📄 Description

Fixes: #4083

Fix up our custom ChoiceField to correctly handle null values for model choice fields. allow_blank signifies whether a value is required, whereas allow_null controls whether null will be passed directly or converted to a string.


🔄 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/4133 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 2/10/2020 **Status:** ✅ Merged **Merged:** 2/10/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `4083-serializer-null-choices` --- ### 📝 Commits (1) - [`7388fa3`](https://github.com/netbox-community/netbox/commit/7388fa35568f9605473457fbf97fe5acd7cc6992) Fixes #4083: Permit nullifying applicable choice fields via API requests ### 📊 Changes **5 files changed** (+41 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `docs/release-notes/version-2.7.md` (+1 -0) 📝 `netbox/dcim/api/serializers.py` (+18 -10) 📝 `netbox/ipam/api/serializers.py` (+2 -2) 📝 `netbox/utilities/api.py` (+19 -2) 📝 `netbox/virtualization/api/serializers.py` (+1 -1) </details> ### 📄 Description ### Fixes: #4083 Fix up our custom ChoiceField to correctly handle null values for model choice fields. `allow_blank` signifies whether a value is required, whereas `allow_null` controls whether `null` will be passed directly or converted to a string. --- <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 22:23:30 +01:00
adam closed this issue 2025-12-29 22:23:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12766