[py3k] Don't sort Action objects
authorRémi Cardona <remi.cardona@logilab.fr>
Fri, 18 Sep 2015 18:01:31 +0200
changeset 10715 edd1ba9bb030
parent 10714 8a2ec43fcf44
child 10716 9a9d57edb1c1
[py3k] Don't sort Action objects In python 3, arbitrary objects are no longer sortable.
web/box.py
--- a/web/box.py	Tue Sep 22 15:25:25 2015 +0200
+++ b/web/box.py	Fri Sep 18 18:01:31 2015 +0200
@@ -43,7 +43,7 @@
         actions_by_cat.setdefault(action.category, []).append(
             (action.title, action) )
     for key, values in actions_by_cat.items():
-        actions_by_cat[key] = [act for title, act in sorted(values)]
+        actions_by_cat[key] = [act for title, act in sorted(values, key=lambda x: x[0])]
     if categories_in_order:
         for cat in categories_in_order:
             if cat in actions_by_cat: