From af9e3ca3cbf23f68f5de050125667c1aad2ba0b6 Mon Sep 17 00:00:00 2001 From: Tomasz Kontusz Date: Sun, 15 Sep 2019 16:51:32 +0200 Subject: [PATCH] Fix test collection --- graphene_django/converter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graphene_django/converter.py b/graphene_django/converter.py index 063d6be..6ebe414 100644 --- a/graphene_django/converter.py +++ b/graphene_django/converter.py @@ -19,7 +19,7 @@ from graphene import ( ) from graphene.types.json import JSONString from graphene.utils.str_converters import to_camel_case, to_const -from graphql import assert_valid_name +from graphql import assert_valid_name, GraphQLError from .compat import ArrayField, HStoreField, JSONField, RangeField from .fields import DjangoListField, DjangoConnectionField @@ -32,7 +32,7 @@ def convert_choice_name(name): name = to_const(force_text(name)) try: assert_valid_name(name) - except AssertionError: + except GraphQLError: name = "A_%s" % name return name @@ -48,7 +48,7 @@ def get_choices(choices): while name in converted_names: name += "_" + str(len(converted_names)) converted_names.append(name) - description = help_text + description = str(help_text) # TODO: translatable description: https://github.com/graphql-python/graphql-core-next/issues/58 yield name, value, description