[PR #17594] [MERGED] Fixes: #17497 - Handle invalid accessor fields in bulk import forms #15134

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

📋 Pull Request Information

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

Base: developHead: 17497-handle-invalid-accessor-field-bulk-import


📝 Commits (3)

  • b761fde Add handling for FieldError to CSVModelChoiceField.to_python to handle invalid accessor field
  • f5f3c58 manufacturer & default_platform should be CSVModelChoiceFields
  • e0ba633 Fix string translation

📊 Changes

2 files changed (+7 additions, -3 deletions)

View changed files

📝 netbox/dcim/forms/bulk_import.py (+2 -2)
📝 netbox/utilities/forms/fields/csv.py (+5 -1)

📄 Description

Fixes: #17497

More generally solves the issue of invalid accessor field names in a BulkImportForm by adding FieldError handling to the to_python method of CSVModelChoiceField.

Note that this will only fix #17497 if https://github.com/netbox-community/netbox/pull/17593 is merged.

Screenshot 2024-09-24 at 5 30 44 PM

🔄 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/17594 **Author:** [@bctiemann](https://github.com/bctiemann) **Created:** 9/24/2024 **Status:** ✅ Merged **Merged:** 9/26/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `17497-handle-invalid-accessor-field-bulk-import` --- ### 📝 Commits (3) - [`b761fde`](https://github.com/netbox-community/netbox/commit/b761fde0d39ebd5f89a9c7c79c8c2618bc9fb714) Add handling for FieldError to CSVModelChoiceField.to_python to handle invalid accessor field - [`f5f3c58`](https://github.com/netbox-community/netbox/commit/f5f3c5880f5de6fd6967c4ba48942554210407d4) manufacturer & default_platform should be CSVModelChoiceFields - [`e0ba633`](https://github.com/netbox-community/netbox/commit/e0ba63388b0f640461b975ab6ecebfa7ae4a09c6) Fix string translation ### 📊 Changes **2 files changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/forms/bulk_import.py` (+2 -2) 📝 `netbox/utilities/forms/fields/csv.py` (+5 -1) </details> ### 📄 Description ### Fixes: #17497 More generally solves the issue of invalid accessor field names in a `BulkImportForm` by adding `FieldError` handling to the `to_python` method of `CSVModelChoiceField`. Note that this will only fix #17497 if https://github.com/netbox-community/netbox/pull/17593 is merged. <img width="884" alt="Screenshot 2024-09-24 at 5 30 44 PM" src="https://github.com/user-attachments/assets/38755db7-883a-4b3c-bcef-532dd168ab4f"> --- <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:11 +01:00
adam closed this issue 2025-12-30 00:20:12 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15134