[PR #14804] [MERGED] Fixes #14755: ValueError in web UI after REST API accepts invalid cus… #14457

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/14804
Author: @Julio-Oliveira-Encora
Created: 1/16/2024
Status: Merged
Merged: 1/19/2024
Merged by: @jeremystretch

Base: developHead: 14755-ValueError_in_web_UI_after_REST_API_accepts_invalid_custom-field_choice-set_data


📝 Commits (5)

  • e87e113 Fixes #14755: ValueError in web UI after REST API accepts invalid custom-field choice-set data
  • f1322c9 PR Comments Addressed
  • bb72af8 Set max_length=2 on extra_choices items; remove custom validation logic
  • 73ab042 Move test for invalid choices to CustomFieldChoiceSetTest
  • b47dd15 Omit unused imports

📊 Changes

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

View changed files

📝 netbox/extras/api/serializers.py (+7 -0)
📝 netbox/extras/tests/test_api.py (+17 -1)

📄 Description

…tom-field choice-set data

Fixes: #14755

Currently, the endpoint "custom-field-choice-sets" accepts one element each (should be two elements each). I changed the Serializer to check the payload and return 400 if it's malformed.


🔄 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/14804 **Author:** [@Julio-Oliveira-Encora](https://github.com/Julio-Oliveira-Encora) **Created:** 1/16/2024 **Status:** ✅ Merged **Merged:** 1/19/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `14755-ValueError_in_web_UI_after_REST_API_accepts_invalid_custom-field_choice-set_data` --- ### 📝 Commits (5) - [`e87e113`](https://github.com/netbox-community/netbox/commit/e87e11377aba35155ca36197982723b910ca47b0) Fixes #14755: ValueError in web UI after REST API accepts invalid custom-field choice-set data - [`f1322c9`](https://github.com/netbox-community/netbox/commit/f1322c932db251bf02893d0d61e7e159d0f97ead) PR Comments Addressed - [`bb72af8`](https://github.com/netbox-community/netbox/commit/bb72af864ba43240babf5361958c3d616f893eb5) Set max_length=2 on extra_choices items; remove custom validation logic - [`73ab042`](https://github.com/netbox-community/netbox/commit/73ab0425e873648fbd73ac399858a9d5f37a63b2) Move test for invalid choices to CustomFieldChoiceSetTest - [`b47dd15`](https://github.com/netbox-community/netbox/commit/b47dd157580c950bf18ae39a31a3b05dff759b5b) Omit unused imports ### 📊 Changes **2 files changed** (+24 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/api/serializers.py` (+7 -0) 📝 `netbox/extras/tests/test_api.py` (+17 -1) </details> ### 📄 Description …tom-field choice-set data ### Fixes: #14755 Currently, the endpoint "custom-field-choice-sets" accepts one element each (should be two elements each). I changed the Serializer to check the payload and return 400 if it's malformed. --- <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:24:35 +01:00
adam closed this issue 2025-12-29 23:24:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14457