File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
django_mongodb_backend/expressions Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -893,14 +893,13 @@ def resolve(node, negated=False):
893893 return node .negate () if negated else node
894894 # Apply De Morgan's Laws.
895895 operator = node .operator .negate () if negated else node .operator
896- negated = negated != (node .operator == Operator .NOT )
896+ if operator == Operator .NOT :
897+ return node .resolve (node .lhs , not negated )
897898 lhs_compound = node .resolve (node .lhs , negated )
898899 rhs_compound = node .resolve (node .rhs , negated )
899- if operator == Operator .OR :
900- return CompoundExpression (should = [lhs_compound , rhs_compound ], minimum_should_match = 1 )
901900 if operator == Operator .AND :
902901 return CompoundExpression (must = [lhs_compound , rhs_compound ])
903- return lhs_compound
902+ return CompoundExpression ( should = [ lhs_compound , rhs_compound ], minimum_should_match = 1 )
904903
905904 def as_mql (self , compiler , connection ):
906905 expression = self .resolve (self )
You can’t perform that action at this time.
0 commit comments