mirror of
https://github.com/django/django.git
synced 2025-10-27 07:36:08 +00:00
Fixed #36388 -- Made QuerySet.union() return self when called with no arguments.
Regression in 9cb8baa0c4.
Thank you to Antoine Humeau for the report and Simon Charette for the review.
This commit is contained in:
committed by
Sarah Boyce
parent
1ba5fe19ca
commit
802baf5da5
@@ -1550,6 +1550,8 @@ class QuerySet(AltersData):
|
||||
if len(qs) == 1:
|
||||
return qs[0]
|
||||
return qs[0]._combinator_query("union", *qs[1:], all=all)
|
||||
elif not other_qs:
|
||||
return self
|
||||
return self._combinator_query("union", *other_qs, all=all)
|
||||
|
||||
def intersection(self, *other_qs):
|
||||
|
||||
Reference in New Issue
Block a user