diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-02-09 01:46:06 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-02-09 14:38:43 -0500 |
| commit | b2afef966dcc44e991f22a8fb68de4f1220bd674 (patch) | |
| tree | f30aed7c4d8876e63d98a239ee8251a427639f1c /lib/sqlalchemy/orm/unitofwork.py | |
| parent | fcb5dbf39569bcacb70a3fed05f469d73b64f116 (diff) | |
| download | sqlalchemy-b2afef966dcc44e991f22a8fb68de4f1220bd674.tar.gz | |
Don't run pending_to_persistent for non-new objects
Fixed fairly simple but critical issue where the
:meth:`.SessionEvents.pending_to_persistent` event would be invoked for
objects not just when they move from pending to persistent, but when they
were also already persistent and just being updated, thus causing the event
to be invoked for all objects on every update.
Fixes: #4489
Change-Id: Ibe147020aa62f7d605cb1029b7f3b776f42e6b43
Diffstat (limited to 'lib/sqlalchemy/orm/unitofwork.py')
| -rw-r--r-- | lib/sqlalchemy/orm/unitofwork.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py index 3b91c8990..1f2221ea9 100644 --- a/lib/sqlalchemy/orm/unitofwork.py +++ b/lib/sqlalchemy/orm/unitofwork.py @@ -440,7 +440,7 @@ class UOWTransaction(object): if isdel: self.session._remove_newly_deleted(isdel) if other: - self.session._register_newly_persistent(other) + self.session._register_persistent(other) class IterateMappersMixin(object): |
