From 6781dc624318fd03032efb3182266bae0a5c8fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Mon, 21 Oct 2013 22:05:48 +0300 Subject: [PATCH] [1.6.x] Fixed #21249 -- variable name typo in compiler.get_grouping() The typo could have consequences in exceptional cases, but I didn't figure out a way to actually produce such a case, so not tests. Report & patch by Michael Manfre. Backport of 86c248aa64 from master --- django/db/models/sql/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index e571ef2222..ca422803a6 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -598,7 +598,7 @@ class SQLCompiler(object): for order, order_params in ordering_group_by: # Even if we have seen the same SQL string, it might have # different params, so, we add same SQL in "has params" case. - if order not in seen or params: + if order not in seen or order_params: result.append(order) params.extend(order_params) seen.add(order)