only update name if name changes

This commit is contained in:
j 2016-01-25 23:02:27 +05:30
parent 2b3edd40dc
commit afbb4e638f
1 changed files with 3 additions and 2 deletions

View File

@ -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()