From 32d1bf2bdbf9006bad8bdd94ff74333da84cae9c Mon Sep 17 00:00:00 2001 From: Matthew Wilkes Date: Tue, 1 Aug 2017 15:37:02 +0100 Subject: Fixed #28454 -- Simplifed use of Query.setup_joins() by returning a named tuple. --- django/db/models/sql/compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django/db/models/sql/compiler.py') diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 2abfd2c289..5ae5213b14 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -818,8 +818,8 @@ class SQLCompiler: related_field_name = f.related_query_name() fields_found.add(related_field_name) - _, _, _, joins, _ = self.query.setup_joins([related_field_name], opts, root_alias) - alias = joins[-1] + join_info = self.query.setup_joins([related_field_name], opts, root_alias) + alias = join_info.joins[-1] from_parent = issubclass(model, opts.model) and model is not opts.model klass_info = { 'model': model, -- cgit v1.3