Use De Morgan's laws to simplify an expression. (#1531)

This commit is contained in:
Artemiy 2017-04-20 17:27:37 +03:00 committed by Stefan Wójcik
parent 358b80d782
commit bd4a603e16

View File

@ -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')