We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be449ab commit 7f65985Copy full SHA for 7f65985
graphene/contrib/django/converter.py
@@ -1,4 +1,5 @@
1
from django.db import models
2
+from django.utils.encoding import force_text
3
4
from ...core.classtypes.enum import Enum
5
from ...core.types.custom_scalars import DateTime, JSONString
@@ -14,7 +15,7 @@
14
15
16
def convert_choices(choices):
17
for value, name in choices:
- yield to_const(name), value
18
+ yield to_const(force_text(name)), value
19
20
21
def convert_django_field_with_choices(field):
graphene/utils/str_converters.py
@@ -18,4 +18,4 @@ def to_snake_case(name):
def to_const(string):
- return re.sub('[\W|^]+', '_', string.format()).upper()
+ return re.sub('[\W|^]+', '_', string).upper()
0 commit comments