Skip to content

Commit 283e727

Browse files
committed
fix: Make is_filerable work well by using callable()
1 parent 0f93fb9 commit 283e727

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

graphene_mongo/fields.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def args(self, args):
6666
@property
6767
def default_filter_args(self):
6868
def is_filterable(kv):
69-
return hasattr(kv[1], '_type') and hasattr(kv[1]._type, '_of_type')
69+
return hasattr(kv[1], '_type') \
70+
and callable(getattr(kv[1]._type, '_of_type', None))
7071

7172
return reduce(
7273
lambda r, kv: r.update({kv[0]: kv[1]._type._of_type()}) or r if is_filterable(kv) else r,

0 commit comments

Comments
 (0)