cleanup in progress apply_changes on peer removal

This commit is contained in:
j 2016-01-14 19:06:07 +05:30
commit 8e3d8b5f8e
3 changed files with 19 additions and 8 deletions

View file

@ -82,6 +82,10 @@ class Changelog(db.Model):
def apply_changes(cls, user, changes):
trigger = changes
for change in changes:
if user.id in state.removepeer:
user.cleanup()
del state.removepeer[user.id]
return False
if not cls.apply_change(user, change, trigger=False):
logger.debug('FAIL %s', change)
trigger = False