From bd4a603e16187478af6950a182cb2d1dabfeb025 Mon Sep 17 00:00:00 2001 From: Artemiy Date: Thu, 20 Apr 2017 17:27:37 +0300 Subject: [PATCH] Use De Morgan's laws to simplify an expression. (#1531) --- mongoengine/fields.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mongoengine/fields.py b/mongoengine/fields.py index b631fc48..0010f818 100644 --- a/mongoengine/fields.py +++ b/mongoengine/fields.py @@ -608,9 +608,9 @@ class EmbeddedDocumentField(BaseField): """ def __init__(self, document_type, **kwargs): - if ( - not isinstance(document_type, six.string_types) and - not issubclass(document_type, EmbeddedDocument) + if not ( + isinstance(document_type, six.string_types) or + issubclass(document_type, EmbeddedDocument) ): self.error('Invalid embedded document class provided to an ' 'EmbeddedDocumentField')