Update query.py

Fixed a bug with double Q object negation:
`~(~Q(condition=True))` was equal to `~Q(condition=True)` before this fix
This commit is contained in:
M1ha Shvn 2022-08-23 14:34:49 +03:00 committed by GitHub
parent 09aeddf677
commit f9d247bf14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -262,7 +262,7 @@ class Q(object):
def __invert__(self): def __invert__(self):
q = copy(self) q = copy(self)
q._negate = True q._negate = not q._negate
return q return q
def __bool__(self): def __bool__(self):