misc: sort using key function (#36515)

This commit is contained in:
Frédéric Péters 2019-11-13 09:50:47 +01:00
parent 11ad87508c
commit a4743c216c
1 changed files with 1 additions and 1 deletions

View File

@ -1441,7 +1441,7 @@ class RootDirectory(AccessControlled, Directory):
for formdef in all_formdefs:
user_forms.extend(get_user_forms(formdef))
user_forms = [x for x in user_forms if x.formdef.is_user_allowed_read(user, x)]
user_forms.sort(lambda x,y: cmp(x.receipt_time, y.receipt_time))
user_forms.sort(key=lambda x: (x.receipt_time,))
if self.category:
r += self.form_list(list_forms, category = self.category,