pull changes in peer sort order, fixes #228

This commit is contained in:
j 2016-02-08 14:33:21 +05:30
commit c82efdaff1
4 changed files with 22 additions and 12 deletions

View file

@ -339,11 +339,7 @@ class Item(db.Model):
if self.meta.get('sharemetadata'):
return
peers = [u for u in self.users if u.id != settings.USER_ID]
def peer_sort(u):
info = u.json()
return ox.sort_string(str(info.get('index', ''))
+ 'Z' + (info.get('name') or ''))
peers.sort(key=peer_sort)
peers.sort(key=lambda u: utils.user_sort_key(u.json()))
sync_from = None
first_peer = None
# get first peer with sharemetadata set