backoffice: sort ids using key function (#36515)

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

View File

@ -189,7 +189,7 @@ class FormDefUI(object):
item_ids_dict = {x: True for x in item_ids}
item_ids = [x for x in ordered_ids if x in item_ids_dict]
else:
item_ids.sort(lambda x,y: cmp(int(x), int(y)))
item_ids.sort(key=lambda x: int(x))
item_ids.reverse()
total_count = len(item_ids)