summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2015-04-19 02:06:17 -0400
committerSimon Charette <charette.s@gmail.com>2015-04-20 15:49:58 -0400
commitb44ed404c78e93e6afea0b011eead327e65fbd2f (patch)
tree74af8ab0c6957819fde21706a0ead693e53cfcd4 /django/db/models/sql
parentffe83d16bd0abfa58e4448cf9d48b52cc43544e9 (diff)
Fixed #24654 -- Based ordering circular references detection on columns.
Thanks to Elmar Bucher for the report and Tim for the review.
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/compiler.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index b70a15755b..7ada8e85d0 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -567,7 +567,7 @@ class SQLCompiler(object):
# Firstly, avoid infinite loops.
if not already_seen:
already_seen = set()
- join_tuple = tuple(self.query.alias_map[j].table_name for j in joins)
+ join_tuple = tuple(getattr(self.query.alias_map[j], 'join_cols', None) for j in joins)
if join_tuple in already_seen:
raise FieldError('Infinite loop caused by ordering.')
already_seen.add(join_tuple)