close db session per change
This commit is contained in:
parent
f8c09226de
commit
d817c67f83
2 changed files with 7 additions and 7 deletions
|
@ -65,6 +65,7 @@ class Changelog(db.Model):
|
|||
def apply_changes(cls, user, changes):
|
||||
trigger = changes
|
||||
for change in changes:
|
||||
with db.session():
|
||||
if not cls.apply_change(user, change, trigger=False):
|
||||
logger.debug('FAIL %s', change)
|
||||
trigger = False
|
||||
|
|
|
@ -297,7 +297,6 @@ class Node(Thread):
|
|||
return False
|
||||
if not changes:
|
||||
return False
|
||||
with db.session():
|
||||
r = Changelog.apply_changes(self.user, changes)
|
||||
return r
|
||||
|
||||
|
|
Loading…
Reference in a new issue