new users should be at end of list

This commit is contained in:
j 2016-03-22 14:04:31 +01:00
parent 51aab8648a
commit bea7c57515

View file

@ -160,6 +160,10 @@ class User(db.Model):
self.save()
if not was_peering:
Changelog.record(state.user(), 'addpeer', self.id, self.nickname)
if not 'index' in self.info:
self.info['index'] = max([
u.info.get('index', -1) for u in User.query.filter_by(peered=True)
]) + 1
self.peered = True
self.save()
if self.id in state.removepeer:
@ -168,6 +172,8 @@ class User(db.Model):
self.pending = ''
self.peered = False
self.queued = False
if 'index' in self.info:
del self.info['index']
self.update_name()
self.save()
if self.name in settings.ui['showFolder']: