| 51 | | **Option 1: take a lighter touch when setting default ordering:** |
| 52 | | {{{#!diff |
| 53 | | diff --git a/django/db/models/query.py b/django/db/models/query.py |
| 54 | | index 6cdd7681b2..9d373410e2 100644 |
| 55 | | --- a/django/db/models/query.py |
| 56 | | +++ b/django/db/models/query.py |
| 57 | | @@ -1702,9 +1702,10 @@ class QuerySet(AltersData): |
| 58 | | clone = self._chain() |
| 59 | | # Clear limits and ordering so they can be reapplied |
| 60 | | clone.query.clear_ordering(force=True) |
| 61 | | - clone.query.default_ordering = True |
| 62 | | clone.query.clear_limits() |
| 63 | | clone.query.combined_queries = (self.query, *(qs.query for qs in other_qs)) |
| 64 | | + if not clone.query.combined_queries: |
| 65 | | + clone.query.default_ordering = True |
| 66 | | clone.query.combinator = combinator |
| 67 | | clone.query.combinator_all = all |
| 68 | | return clone |
| 69 | | }}} |
| | 51 | **Option 1: take a lighter touch when setting default ordering after union?** (EDIT: removed incorrect suggested diff.) |