From 9344b84d86e9eebd1e65bc0191aff57d786cd2c4 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 19 Jan 2019 16:40:06 +0530 Subject: [PATCH] remove double peering issues --- oml/user/models.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/oml/user/models.py b/oml/user/models.py index 0e09306..9679a00 100644 --- a/oml/user/models.py +++ b/oml/user/models.py @@ -154,15 +154,12 @@ class User(db.Model): if username: self.info['username'] = username self.update_name() - # FIXME: need to set peered to False to not trigger changelog event - # before other side receives acceptPeering request - self.peered = False - self.save() if not was_peering: add_record('addpeer', self.id, self.nickname) if 'index' not in self.info: self.info['index'] = max([ u.info.get('index', -1) for u in User.query.filter_by(peered=True) + if u.id != self.id ] + [0]) + 1 self.peered = True self.save()