Skip to content

Commit

Permalink
Fix some linter warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Dec 1, 2017
1 parent d8c39a5 commit baa454d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions graphene_sqlalchemy/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def convert_column_to_float(type, column, registry=None):


@convert_sqlalchemy_type.register(types.Enum)
def convert_column_to_enum(type, column, registry=None):
def convert_enum_to_enum(type, column, registry=None):
if registry is None:
from .registry import get_global_registry
registry = get_global_registry()
Expand All @@ -142,7 +142,7 @@ def convert_column_to_enum(type, column, registry=None):


@convert_sqlalchemy_type.register(ChoiceType)
def convert_column_to_enum(type, column, registry=None):
def convert_choice_to_enum(type, column, registry=None):
name = '{}_{}'.format(column.table.name, column.name).upper()
return Enum(name, type.choices, description=get_column_doc(column))

Expand Down
3 changes: 2 additions & 1 deletion graphene_sqlalchemy/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_type_for_enum(self, sql_type):
if gql_type:
if dict(items) != {
key: value.value for key, value
in gql_type._meta.enum.__members__.items()}:
in gql_type._meta.enum.__members__.items()}:
raise TypeError(
'Different enums with the same name {}'.format(name))
else:
Expand All @@ -64,6 +64,7 @@ def get_type_for_enum(self, sql_type):
self._registry_enums[name] = gql_type
return gql_type


registry = None


Expand Down
1 change: 0 additions & 1 deletion graphene_sqlalchemy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ def is_mapped_instance(cls):

def to_type_name(name):
return ''.join(part[:1].upper() + part[1:] for part in name.split('_'))

0 comments on commit baa454d

Please sign in to comment.