summaryrefslogtreecommitdiff
path: root/django/db/models/query_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/query_utils.py')
-rw-r--r--django/db/models/query_utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py
index c957ffa564..ae0f886107 100644
--- a/django/db/models/query_utils.py
+++ b/django/db/models/query_utils.py
@@ -40,7 +40,7 @@ class Q(tree.Node):
super().__init__(children=[*args, *sorted(kwargs.items())], connector=_connector, negated=_negated)
def _combine(self, other, conn):
- if not isinstance(other, Q):
+ if not(isinstance(other, Q) or getattr(other, 'conditional', False) is True):
raise TypeError(other)
# If the other Q() is empty, ignore it and just use `self`.