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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user