From 1e1904f8680937e42497995bab42d39a4045148f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 19 May 2012 19:40:13 -0400 Subject: [PATCH] fix logic here broken by the change for enable_relationship_loading --- lib/sqlalchemy/orm/strategies.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py index e1f8387939..70e06723ac 100644 --- a/lib/sqlalchemy/orm/strategies.py +++ b/lib/sqlalchemy/orm/strategies.py @@ -448,10 +448,14 @@ class LazyLoader(AbstractRelationshipLoader): return criterion def _load_for_state(self, state, passive): - if not state.session_id or \ - not state.key and \ - not self.parent_property.load_on_pending and \ - not state._load_pending: + if not state.key and \ + ( + ( + not self.parent_property.load_on_pending + and not state._load_pending + ) + or not state.session_id + ): return attributes.ATTR_EMPTY pending = not state.key -- 2.47.3