From c786ceb760563e5cdc205c1dd2b95e6513426244 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 20 May 2014 14:32:21 +0200 Subject: [PATCH] [FIX] the badges should be ordered by most popular first --- addons/website_forum/controllers/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index f196909b065..b94e818d0c5 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -599,6 +599,7 @@ class WebsiteForum(http.Controller): Badge = request.registry['gamification.badge'] badge_ids = Badge.search(cr, SUPERUSER_ID, [('challenge_ids.category', '=', 'forum')], context=context) badges = Badge.browse(cr, uid, badge_ids, context=context) + badges = sorted(badges, key=lambda b: b.stat_count_distinct, reverse=True) values = self._prepare_forum_values(forum=forum, searches={'badges': True}) values.update({ 'badges': badges,