From cb362a6750f421cc7ad7fabcd261da98de1cfcda Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 15 Sep 2017 08:37:46 -0400 Subject: [PATCH] Removed unnecessary check in SQLCompiler.get_related_selections(). --- 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 37f5cce37a..01c303eb7e 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -740,7 +740,7 @@ class SQLCompiler: return chain(direct_choices, reverse_choices) related_klass_infos = [] - if not restricted and self.query.max_depth and cur_depth > self.query.max_depth: + if not restricted and cur_depth > self.query.max_depth: # We've recursed far enough; bail out. return related_klass_infos