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):
893
893
return node .negate () if negated else node
894
894
# Apply De Morgan's Laws.
895
895
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 )
897
898
lhs_compound = node .resolve (node .lhs , negated )
898
899
rhs_compound = node .resolve (node .rhs , negated )
899
- if operator == Operator .OR :
900
- return CompoundExpression (should = [lhs_compound , rhs_compound ], minimum_should_match = 1 )
901
900
if operator == Operator .AND :
902
901
return CompoundExpression (must = [lhs_compound , rhs_compound ])
903
- return lhs_compound
902
+ return CompoundExpression ( should = [ lhs_compound , rhs_compound ], minimum_should_match = 1 )
904
903
905
904
def as_mql (self , compiler , connection ):
906
905
expression = self .resolve (self )
You can’t perform that action at this time.
0 commit comments