[PR #20725] [MERGED] 20645 CSVChoiceField use default if blank #16029

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20725
Author: @arthanson
Created: 10/30/2025
Status: Merged
Merged: 11/6/2025
Merged by: @bctiemann

Base: mainHead: 20645-bulk-upload


📝 Commits (1)

  • 90712fa 20645 CSVChoiceField use default if blank

📊 Changes

2 files changed (+54 additions, -1 deletions)

View changed files

📝 netbox/utilities/forms/fields/csv.py (+21 -1)
📝 netbox/utilities/tests/test_forms.py (+33 -0)

📄 Description

Fixes: #20645

This fix now allows any other model using CSVChoiceField to properly use model defaults when CSV columns are present but empty. For example, when a cable is imported with an empty status field.

This fix is limited to CSV import forms only and doesn't affect web UI forms or other form types.


🔄 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/20725 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 10/30/2025 **Status:** ✅ Merged **Merged:** 11/6/2025 **Merged by:** [@bctiemann](https://github.com/bctiemann) **Base:** `main` ← **Head:** `20645-bulk-upload` --- ### 📝 Commits (1) - [`90712fa`](https://github.com/netbox-community/netbox/commit/90712fa865dbee929d9ee01bee788ff6957246d4) 20645 CSVChoiceField use default if blank ### 📊 Changes **2 files changed** (+54 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/utilities/forms/fields/csv.py` (+21 -1) 📝 `netbox/utilities/tests/test_forms.py` (+33 -0) </details> ### 📄 Description ### Fixes: #20645 This fix now allows any other model using CSVChoiceField to properly use model defaults when CSV columns are present but empty. For example, when a cable is imported with an empty status field. This fix is limited to CSV import forms only and doesn't affect web UI forms or other form types. --- <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:24 +01:00
adam closed this issue 2025-12-30 00:25:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16029