summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/context.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/orm/context.py')
-rw-r--r--lib/sqlalchemy/orm/context.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py
index 9cfa0fdc6..45ab64593 100644
--- a/lib/sqlalchemy/orm/context.py
+++ b/lib/sqlalchemy/orm/context.py
@@ -2136,7 +2136,7 @@ def _legacy_determine_last_joined_entity(setup_joins, entity_zero):
if right is not None and "parententity" in right._annotations:
right = right._annotations["parententity"].entity
- if onclause is not None and right is not None:
+ if right is not None:
last_entity = right
insp = inspect(last_entity)
if insp.is_clause_element or insp.is_aliased_class or insp.is_mapper: