diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-05-23 11:35:51 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-05-23 11:35:51 -0400 |
commit | 174ece15cb167b774d0b48aa2083e13837f99017 (patch) | |
tree | 7613a77df19e6908d7030b1e2f3f7bdd2323dbe5 /lib/sqlalchemy | |
parent | 999bd50753a46785d8031d080af661f608b867c5 (diff) | |
download | sqlalchemy-174ece15cb167b774d0b48aa2083e13837f99017.tar.gz |
Include active_history when propagating attribute listeners
Fixed issue where the :paramref:`.AttributeEvents.active_history` flag
would not be set for an event listener that propgated to a subclass via the
:paramref:`.AttributeEvents.propagate` flag. This bug has been present
for the full span of the :class:`.AttributeEvents` system.
Fixes: #4695
Change-Id: Ie384f4847f37c267d94b6d56e7538438efc1a54c
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/orm/events.py | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index 674c57fea..01f19d991 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -99,6 +99,8 @@ class QueryableAttribute( for base in manager._bases: if key in base: self.dispatch._update(base[key].dispatch) + if base[key].dispatch._active_history: + self.dispatch._active_history = True @util.memoized_property def _supports_population(self): diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py index 8a310479c..d73a20e93 100644 --- a/lib/sqlalchemy/orm/events.py +++ b/lib/sqlalchemy/orm/events.py @@ -2009,6 +2009,8 @@ class AttributeEvents(event.Events): event_key.with_dispatch_target(mgr[target.key]).base_listen( propagate=True ) + if active_history: + mgr[target.key].dispatch._active_history = True def append(self, target, value, initiator): """Receive a collection append event. |