Fix sorting of bundled notifications

This commit is contained in:
Jason McBrayer 2019-11-08 10:24:10 -05:00
parent 428c1e1508
commit f6d0cfee61
1 changed files with 3 additions and 0 deletions

View File

@ -640,12 +640,15 @@ def note(request, next=None, prev=None):
return str(note.status.id) + note.type
except:
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)
for _, group in groupby(sorted_notes, bundle_key):
group = LabeledList(group)
group.accounts = [x.account for x in group]
groups.append(group)
groups.sort(key=group_sort_key, reverse=True)
else:
groups.append(notes)