projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8da2cb6
)
[FIX] the badges should be ordered by most popular first
author
Martin Trigaux
<mat@openerp.com>
Tue, 20 May 2014 12:32:21 +0000
(14:32 +0200)
committer
Martin Trigaux
<mat@openerp.com>
Tue, 20 May 2014 12:32:21 +0000
(14:32 +0200)
addons/website_forum/controllers/main.py
patch
|
blob
|
history
diff --git
a/addons/website_forum/controllers/main.py
b/addons/website_forum/controllers/main.py
index
f196909
..
b94e818
100644
(file)
--- 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,