diff --git a/examples/cookbook/requirements.txt b/examples/cookbook/requirements.txt index a5b0b96..74baf12 100644 --- a/examples/cookbook/requirements.txt +++ b/examples/cookbook/requirements.txt @@ -1,5 +1,5 @@ graphene>=2.1,<3 graphene-django>=2.1,<3 graphql-core>=2.1,<3 -django==3.1.14 +django==3.2.24 django-filter>=2 diff --git a/graphene_django/converter.py b/graphene_django/converter.py index b73135e..7eba22a 100644 --- a/graphene_django/converter.py +++ b/graphene_django/converter.py @@ -1,5 +1,4 @@ import inspect -from collections import OrderedDict from collections.abc import Callable from functools import partial, singledispatch, wraps @@ -75,8 +74,13 @@ def get_choices(choices): converted_names = [] if isinstance(choices, Callable): choices = choices() - if isinstance(choices, OrderedDict): + + # In restframework==3.15.0, choices are not passed + # as OrderedDict anymore, so it's safer to check + # for a dict + if isinstance(choices, dict): choices = choices.items() + for value, help_text in choices: if isinstance(help_text, (tuple, list)): yield from get_choices(help_text)