Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of extra_choices #17691

Merged

Conversation

gellis713
Copy link
Contributor

Fixes: #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.

Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gellis713!

@jeremystretch jeremystretch merged commit ec89a9b into netbox-community:develop Oct 9, 2024
3 checks passed
@gellis713 gellis713 deleted the 17562-graphql-choiceset branch October 10, 2024 17:16
bctiemann pushed a commit that referenced this pull request Oct 11, 2024
* Align strawberry resolver with expected return type

* Align test data with expected representation of extra_choices in CustomFieldChoiceSet model

---------

Co-authored-by: Griffin Ellis <griffin.ellis@pico.net>
jeremystretch pushed a commit to alehaa/netbox that referenced this pull request Oct 11, 2024
* Align strawberry resolver with expected return type

* Align test data with expected representation of extra_choices in CustomFieldChoiceSet model

---------

Co-authored-by: Griffin Ellis <griffin.ellis@pico.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQL CustomFieldChoiceSet erroring on extra_choices
2 participants