new users should be at end of list
This commit is contained in:
parent
51aab8648a
commit
bea7c57515
1 changed files with 6 additions and 0 deletions
|
@ -160,6 +160,10 @@ class User(db.Model):
|
||||||
self.save()
|
self.save()
|
||||||
if not was_peering:
|
if not was_peering:
|
||||||
Changelog.record(state.user(), 'addpeer', self.id, self.nickname)
|
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.peered = True
|
||||||
self.save()
|
self.save()
|
||||||
if self.id in state.removepeer:
|
if self.id in state.removepeer:
|
||||||
|
@ -168,6 +172,8 @@ class User(db.Model):
|
||||||
self.pending = ''
|
self.pending = ''
|
||||||
self.peered = False
|
self.peered = False
|
||||||
self.queued = False
|
self.queued = False
|
||||||
|
if 'index' in self.info:
|
||||||
|
del self.info['index']
|
||||||
self.update_name()
|
self.update_name()
|
||||||
self.save()
|
self.save()
|
||||||
if self.name in settings.ui['showFolder']:
|
if self.name in settings.ui['showFolder']:
|
||||||
|
|
Loading…
Add table
Reference in a new issue