1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #30501 -- Preventing QuerySet.reverse() from mutating expressions in QuerySet.order_by and Meta.ordering.

This commit is contained in:
Mariusz Felisiak
2019-05-23 20:33:37 +02:00
committed by GitHub
parent 2007e11d70
commit f8b8b00f01
2 changed files with 32 additions and 7 deletions

View File

@@ -281,6 +281,7 @@ class SQLCompiler:
if not isinstance(field, OrderBy):
field = field.asc()
if not self.query.standard_ordering:
field = field.copy()
field.reverse_ordering()
order_by.append((field, False))
continue