admin: sort emails/texts using key function (#36515)
This commit is contained in:
parent
61efee3db9
commit
0db7cb0804
|
@ -168,8 +168,7 @@ class EmailsDirectory(Directory):
|
|||
r += htmltext('<h3>%s</h3>') % category_key
|
||||
|
||||
keys = categories.get(category_key)
|
||||
keys.sort(lambda x,y: cmp(_(self.emails_dict[x]['description']),
|
||||
_(self.emails_dict[y]['description'])))
|
||||
keys.sort(key=lambda x: _(self.emails_dict[x]['description']))
|
||||
r += htmltext('<ul>')
|
||||
for email_key in keys:
|
||||
email_values = self.emails_dict[email_key]
|
||||
|
|
|
@ -93,8 +93,7 @@ class TextsDirectory(Directory):
|
|||
r += htmltext('<h3>%s</h3>') % category_key
|
||||
|
||||
keys = categories.get(category_key)
|
||||
keys.sort(lambda x,y: cmp(_(self.texts_dict[x]['description']),
|
||||
_(self.texts_dict[y]['description'])))
|
||||
keys.sort(key=lambda x: _(self.texts_dict[x]['description']))
|
||||
r += htmltext('<ul>')
|
||||
for text_key in keys:
|
||||
text_values = self.texts_dict[text_key]
|
||||
|
|
Loading…
Reference in New Issue