Merge "Flush objects by ourselves before processing before_commit event"

This commit is contained in:
Jenkins 2017-04-07 11:44:57 +00:00 committed by Gerrit Code Review
commit 83ecf60999
1 changed files with 4 additions and 1 deletions

View File

@ -278,7 +278,10 @@ def load_one_to_manys(session):
# have eliminated all places where related objects are constructed
# using a key rather than a relationship.
add_to_rel_load_list(session) # capture any new objects
# capture any new objects
if session.new:
session.flush()
if session.transaction.nested:
# wait until final commit
return