diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-18 23:17:33 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-18 23:17:33 -0400 |
| commit | 9c6e45ff0157cdd4139cdeb68d38867e2baeaeb5 (patch) | |
| tree | 352f50c8a5d8e66b62b40868dcb5110eb20ba70b /lib/sqlalchemy | |
| parent | 0a54a4a4b0897bb8eaaf7a7857fb54924ccbd7ef (diff) | |
| download | sqlalchemy-9c6e45ff0157cdd4139cdeb68d38867e2baeaeb5.tar.gz | |
Fixed bug in ORM-level event registration where the "raw" or
"propagate" flags could potentially be mis-configured in some
"unmapped base class" configurations. Also in 0.8.3.
[ticket:2786]
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/events.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py index 97019bb4e..14b3a770e 100644 --- a/lib/sqlalchemy/orm/events.py +++ b/lib/sqlalchemy/orm/events.py @@ -360,14 +360,17 @@ class _EventsHold(object): def populate(cls, class_, subject): for subclass in class_.__mro__: if subclass in cls.all_holds: - if subclass is class_: - collection = cls.all_holds.pop(subclass) - else: - collection = cls.all_holds[subclass] + collection = cls.all_holds[subclass] for ident, fn, raw, propagate in collection: if propagate or subclass is class_: + # since we can't be sure in what order different classes + # in a hierarchy are triggered with populate(), + # we rely upon _EventsHold for all event + # assignment, instead of using the generic propagate + # flag. subject.dispatch._listen(subject, ident, - fn, raw, propagate) + fn, raw=raw, + propagate=False) class _InstanceEventsHold(_EventsHold): |
