[PR #13685] [MERGED] Fixes: #13682 - Fix custom field exceptions and validation #14237

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13685
Author: @DanSheps
Created: 9/5/2023
Status: Merged
Merged: 9/6/2023
Merged by: @jeremystretch

Base: developHead: 13682-fix-custom-field-selection-creation


📝 Commits (5)

  • f57925a Fixes: #13682 - Fix custom field exceptions and validation
  • d2c32c9 Add tests
  • 9d6f69a Remove default setting for multi-select/multi-object and return slice of choices and annotate.
  • 0c8712a Remove redundant default choice valiadtion; introduce values property on CustomFieldChoiceSet
  • 0de4fdd Refactor test

📊 Changes

2 files changed (+108 additions, -15 deletions)

View changed files

📝 netbox/extras/models/customfields.py (+17 -15)
📝 netbox/extras/tests/test_customfields.py (+91 -0)

📄 Description

Fixes: #13682

Fix custom field exceptions and validation

  • Change self.message to err.message to properly reference nested exception
  • Change clean logic to set "default_value" to list for multiselect and multiobject
  • Change validation logic to deconstruct choice set tuple for select to only check the value

🔄 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/13685 **Author:** [@DanSheps](https://github.com/DanSheps) **Created:** 9/5/2023 **Status:** ✅ Merged **Merged:** 9/6/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `13682-fix-custom-field-selection-creation` --- ### 📝 Commits (5) - [`f57925a`](https://github.com/netbox-community/netbox/commit/f57925aa020f91f8b901819f51b9242a63eee812) Fixes: #13682 - Fix custom field exceptions and validation - [`d2c32c9`](https://github.com/netbox-community/netbox/commit/d2c32c959402e4ca66c0555b3c1c085fd6ee98c8) Add tests - [`9d6f69a`](https://github.com/netbox-community/netbox/commit/9d6f69aa2686dcf3812e89765970ff1320fc8122) Remove default setting for multi-select/multi-object and return slice of choices and annotate. - [`0c8712a`](https://github.com/netbox-community/netbox/commit/0c8712aeaaf0a1bcdb912d56b2b33c7d02fcdb9f) Remove redundant default choice valiadtion; introduce values property on CustomFieldChoiceSet - [`0de4fdd`](https://github.com/netbox-community/netbox/commit/0de4fdde604c8f42643a89f8d9cc50208d972a4f) Refactor test ### 📊 Changes **2 files changed** (+108 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/models/customfields.py` (+17 -15) 📝 `netbox/extras/tests/test_customfields.py` (+91 -0) </details> ### 📄 Description ### Fixes: #13682 Fix custom field exceptions and validation * Change self.message to err.message to properly reference nested exception * Change clean logic to set "default_value" to list for multiselect and multiobject * Change validation logic to deconstruct choice set tuple for select to only check the value --- <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 23:23:20 +01:00
adam closed this issue 2025-12-29 23:23:20 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14237