Skip to content

Commit 76daafb

Browse files
committed
Fixed flake issues
1 parent 791a167 commit 76daafb

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

graphene_sqlalchemy/converter.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ def dynamic_type():
4747
return Field(List(_type))
4848

4949
return Dynamic(dynamic_type)
50-
50+
51+
5152
def convert_sqlalchemy_hybrid_method(hybrid_item):
52-
return String(description=getattr(hybrid_item, '__doc__', None),
53-
required=False)
53+
return String(description=getattr(hybrid_item, '__doc__', None),
54+
required=False)
55+
5456

5557
def convert_sqlalchemy_composite(composite, registry):
5658
converter = registry.get_converter_for_composite(composite.composite_class)

graphene_sqlalchemy/types.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ def construct_fields(model, registry, only_fields, exclude_fields):
5050
name = hybrid_item.__name__
5151

5252
is_not_in_only = only_fields and name not in only_fields
53-
is_already_created = name in options.fields
54-
is_excluded = name in exclude_fields or is_already_created
53+
# is_already_created = name in options.fields
54+
is_excluded = name in exclude_fields # or is_already_created
5555

5656
if is_not_in_only or is_excluded:
57-
# We skip this field if we specify only_fields and is not
58-
# in there. Or when we excldue this field in exclude_fields
59-
57+
# We skip this field if we specify only_fields and is not
58+
# in there. Or when we excldue this field in exclude_fields
6059
continue
60+
6161
converted_hybrid_property = convert_sqlalchemy_hybrid_method(
62-
hybrid_item)
62+
hybrid_item
63+
)
6364
fields[name] = converted_hybrid_property
6465

6566
# Get all the columns for the relationships on the model

0 commit comments

Comments
 (0)