From f4c48cc1fd642e20e1aaf163fcc74892a7be331a Mon Sep 17 00:00:00 2001 From: Sebastian Chamena Date: Mon, 27 May 2019 22:06:45 -0300 Subject: [PATCH] fixes ListField bug --- graphene_mongo/types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graphene_mongo/types.py b/graphene_mongo/types.py index 84771248..b769913f 100644 --- a/graphene_mongo/types.py +++ b/graphene_mongo/types.py @@ -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) \