misc: update ranked items csv value for py3 (#36515)
This commit is contained in:
parent
b48283f626
commit
a55daeec35
|
@ -2299,9 +2299,9 @@ class RankedItemsField(WidgetField):
|
|||
return ['']
|
||||
if type(value) is not dict:
|
||||
value = {}
|
||||
items = value.items()
|
||||
items.sort(lambda x,y: cmp(x[1], y[1]))
|
||||
ranked = [x[0] for x in items if x[1] is not None]
|
||||
items = [x for x in value.items() if x[1] is not None]
|
||||
items.sort(key=lambda x: x[1])
|
||||
ranked = [x[0] for x in items]
|
||||
return ranked + ['' for x in range(len(self.items)-len(ranked))]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue