always ignore empty Q objects, if the new Q is empty, the old one will be returned.
This commit is contained in:
@@ -59,6 +59,8 @@ class Q(object):
|
||||
|
||||
def _combine(self, other, op):
|
||||
obj = Q()
|
||||
if not other.query[0]:
|
||||
return self
|
||||
if self.query[0]:
|
||||
obj.query = ['('] + copy.deepcopy(self.query) + [op] + copy.deepcopy(other.query) + [')']
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user