From afbb4e638fb7a632b73984b74c40f1d66520ae23 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 25 Jan 2016 23:02:27 +0530 Subject: [PATCH] only update name if name changes --- oml/localnodes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oml/localnodes.py b/oml/localnodes.py index fd9288a..bfc334e 100644 --- a/oml/localnodes.py +++ b/oml/localnodes.py @@ -142,9 +142,10 @@ class LocalNodesBase(Thread): with db.session(): u = user.models.User.get(data['id']) if u: - u.info['username'] = data['username'] + if u.info['username'] != data['username']: + u.info['username'] = data['username'] + u.update_name() u.info['local'] = data - u.update_name() u.save() state.nodes.queue('add', u.id) self.send()