diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2021-02-18 14:01:48 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-02-18 22:20:36 +0100 |
| commit | f2bef2b7bc6c817af0f5fa77e1052a1f5ce12f71 (patch) | |
| tree | 581b8ed4f6aaeb9533153855412711c645598a6d /django | |
| parent | efce21497cc21140c5fe2b133064cd815c97b3f5 (diff) | |
Fixed #32455 -- Allowed right combining Q() with boolean expressions.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/query_utils.py | 2 |
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`. |
