From 86c248aa646183ef4a1cb407bb3e4cb597272f63 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] 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. --- 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 3707348968..fc5a4285a1 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -575,7 +575,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)