1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #24654 -- Based ordering circular references detection on columns.

Thanks to Elmar Bucher for the report and Tim for the review.
This commit is contained in:
Simon Charette
2015-04-19 02:06:17 -04:00
parent ffe83d16bd
commit b44ed404c7
3 changed files with 33 additions and 2 deletions

View File

@@ -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)