diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-03-18 17:46:24 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-03-18 20:19:48 -0400 |
commit | 2c7eb1f7dd20059ab74081947676a0e3389f3464 (patch) | |
tree | bd77685a6d48ca284cea5e066e9eb7d90fc43857 /lib/sqlalchemy/orm/context.py | |
parent | 3fec5028e695ad138aa46a0ae66c55e8bcb653f6 (diff) | |
download | sqlalchemy-2c7eb1f7dd20059ab74081947676a0e3389f3464.tar.gz |
repair legacy_last_joined_entity for no onclause
Fixed regression where the :meth:`_orm.Query.filter_by` method would fail
to locate the correct source entity if the :meth:`_orm.Query.join` method
had been used targeting an entity without any kind of ON clause.
Fixes: #6092
Change-Id: I38d9099844f842f314c6673bd922467242409cdb
Diffstat (limited to 'lib/sqlalchemy/orm/context.py')
-rw-r--r-- | lib/sqlalchemy/orm/context.py | 2 |
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: |