mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-24 19:12:03 +03:00
refactor how _convert_choices_to_enum is evaluated.
This commit is contained in:
parent
aeb04d5b5c
commit
040a48b1f3
|
@ -45,14 +45,10 @@ def construct_fields(
|
|||
# in there. Or when we exclude this field in exclude_fields.
|
||||
# Or when there is no back reference.
|
||||
continue
|
||||
|
||||
_convert_choices_to_enum = convert_choices_to_enum
|
||||
if not isinstance(_convert_choices_to_enum, bool):
|
||||
# then `convert_choices_to_enum` is a list of field names to convert
|
||||
if name in _convert_choices_to_enum:
|
||||
_convert_choices_to_enum = True
|
||||
else:
|
||||
_convert_choices_to_enum = False
|
||||
_convert_choices_to_enum = name in _convert_choices_to_enum
|
||||
|
||||
converted = convert_django_field_with_choices(
|
||||
field, registry, convert_choices_to_enum=_convert_choices_to_enum
|
||||
|
|
Loading…
Reference in New Issue
Block a user