diff options
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/compiler.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 05597173ee..09a9d73077 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -383,7 +383,7 @@ class SQLCompiler: # not taken into account so we strip it. When this entire method # is refactored into expressions, then we can check each part as we # generate it. - without_ordering = self.ordering_parts.search(sql).group(1) + without_ordering = self.ordering_parts.search(sql)[1] params_hash = make_hashable(params) if (without_ordering, params_hash) in seen: continue @@ -396,7 +396,7 @@ class SQLCompiler: if self.query.distinct and not self.query.distinct_fields: select_sql = [t[1] for t in select] for expr, (sql, params, is_ref) in order_by: - without_ordering = self.ordering_parts.search(sql).group(1) + without_ordering = self.ordering_parts.search(sql)[1] if not is_ref and (without_ordering, params) not in select_sql: extra_select.append((expr, (without_ordering, params), None)) return extra_select |
