diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-28 18:39:19 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-28 18:41:12 -0400 |
| commit | 9c52d9a507a738ae68f0a6eae09d87959995b981 (patch) | |
| tree | 4acd172acd08b277036c0bc3bdd8a14e9f2a4eb1 /lib/sqlalchemy/orm/util.py | |
| parent | c90396fbe7424c481f8f4ee18b6cedd1fa09c711 (diff) | |
| download | sqlalchemy-9c52d9a507a738ae68f0a6eae09d87959995b981.tar.gz | |
apply loader criteria more specifically when refresh is true
Fixed bug in :func:`_orm.with_loader_criteria` function where loader
criteria would not be applied to a joined eager load that were invoked
within the scope of a refresh operation for the parent object.
Fixes: #7862
Change-Id: If1ac86eaa95880b5ec5bdeee292d6e8000aac705
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
| -rw-r--r-- | lib/sqlalchemy/orm/util.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index 980002776..2b49d4400 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -1184,8 +1184,7 @@ class LoaderCriteriaOption(CriteriaOption): # if options to limit the criteria to immediate query only, # use compile_state.attributes instead - if not compile_state.compile_options._for_refresh_state: - self.get_global_criteria(compile_state.global_attributes) + self.get_global_criteria(compile_state.global_attributes) def get_global_criteria(self, attributes): for mp in self._all_mappers(): |
