mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-23 15:23:52 -05:00
Fix sorting of bundled notifications
This commit is contained in:
parent
428c1e1508
commit
f6d0cfee61
@ -640,12 +640,15 @@ def note(request, next=None, prev=None):
|
|||||||
return str(note.status.id) + note.type
|
return str(note.status.id) + note.type
|
||||||
except:
|
except:
|
||||||
return str(note.id) + note.type
|
return str(note.id) + note.type
|
||||||
|
def group_sort_key(group):
|
||||||
|
return max([k.id for k in group])
|
||||||
|
|
||||||
sorted_notes = sorted(notes, key=bundle_key, reverse=True)
|
sorted_notes = sorted(notes, key=bundle_key, reverse=True)
|
||||||
for _, group in groupby(sorted_notes, bundle_key):
|
for _, group in groupby(sorted_notes, bundle_key):
|
||||||
group = LabeledList(group)
|
group = LabeledList(group)
|
||||||
group.accounts = [x.account for x in group]
|
group.accounts = [x.account for x in group]
|
||||||
groups.append(group)
|
groups.append(group)
|
||||||
|
groups.sort(key=group_sort_key, reverse=True)
|
||||||
else:
|
else:
|
||||||
groups.append(notes)
|
groups.append(notes)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user