[PR #17691] [MERGED] Fix parsing of extra_choices #15165

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17691
Author: @gellis713
Created: 10/7/2024
Status: Merged
Merged: 10/9/2024
Merged by: @jeremystretch

Base: developHead: 17562-graphql-choiceset


📝 Commits (2)

  • 5a032c2 Align strawberry resolver with expected return type
  • daee62c Align test data with expected representation of extra_choices in CustomFieldChoiceSet model

📊 Changes

2 files changed (+13 additions, -4 deletions)

View changed files

📝 netbox/extras/graphql/types.py (+1 -1)
📝 netbox/extras/tests/test_api.py (+12 -3)

📄 Description

Fixes: https://github.com/netbox-community/netbox/issues/17562

Updates extra_choices to be a list of a list of strings which is what Django reports as the relevant types at each level. In addition, it seems some of the test data for extra_choices was a list of strings instead of a nested list.

The form code in CustomFieldChoiceSetForm automatically takes single-items and creates a label so there is a list of tuples being passed into the model.


🔄 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/17691 **Author:** [@gellis713](https://github.com/gellis713) **Created:** 10/7/2024 **Status:** ✅ Merged **Merged:** 10/9/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `17562-graphql-choiceset` --- ### 📝 Commits (2) - [`5a032c2`](https://github.com/netbox-community/netbox/commit/5a032c234574ea0f5df7fd94bed24b8bf0ad1f75) Align strawberry resolver with expected return type - [`daee62c`](https://github.com/netbox-community/netbox/commit/daee62c4e7ac3cdfbda7f692861ca01b1862cbdd) Align test data with expected representation of extra_choices in CustomFieldChoiceSet model ### 📊 Changes **2 files changed** (+13 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/graphql/types.py` (+1 -1) 📝 `netbox/extras/tests/test_api.py` (+12 -3) </details> ### 📄 Description Fixes: https://github.com/netbox-community/netbox/issues/17562 Updates extra_choices to be a list of a list of strings which is what Django reports as the relevant types at each level. In addition, it seems some of the test data for extra_choices was a list of strings instead of a nested list. The form code in CustomFieldChoiceSetForm automatically takes single-items and creates a label so there is a list of tuples being passed into the model. --- <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:21 +01:00
adam closed this issue 2025-12-30 00:20:21 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15165