This commit is contained in:
j 2015-12-25 20:28:41 +05:30
parent 619a2fbd37
commit d9bd113ee5
2 changed files with 7 additions and 7 deletions

View file

@ -65,12 +65,11 @@ class Changelog(db.Model):
def apply_changes(cls, user, changes): def apply_changes(cls, user, changes):
trigger = changes trigger = changes
for change in changes: for change in changes:
with db.session(): if not cls.apply_change(user, change, trigger=False):
if not cls.apply_change(user, change, trigger=False): logger.debug('FAIL %s', change)
logger.debug('FAIL %s', change) trigger = False
trigger = False break
break return False
return False
if trigger: if trigger:
trigger_event('change', {}); trigger_event('change', {});
return True return True

View file

@ -297,7 +297,8 @@ class Node(Thread):
return False return False
if not changes: if not changes:
return False return False
r = Changelog.apply_changes(self.user, changes) with db.session():
r = Changelog.apply_changes(self.user, changes)
return r return r
def pushChanges(self, changes): def pushChanges(self, changes):