Skip to content

Commit

Permalink
fixes ListField bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Chamena committed May 28, 2019
1 parent fbe472c commit f4c48cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion graphene_mongo/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def construct_fields(model, registry, only_fields, exclude_fields):
# in there. Or when we exclude this field in exclude_fields
continue
if isinstance(field, mongoengine.ListField):
# Take care of list of self-reference.
if not field.field:
continue
# Take care of list of self-reference.
document_type_obj = field.field.__dict__.get('document_type_obj', None)
if document_type_obj == model._class_name \
or isinstance(document_type_obj, model) \
Expand Down

0 comments on commit f4c48cc

Please sign in to comment.