[FIX] website_forum: users count requires super-user permissions

Introduced at 893d7fa864
during new API conversion: missing `sudo()`.

Fixes #6578
This commit is contained in:
Olivier Dony
2015-05-06 15:44:31 +02:00
parent 2afb13a9b4
commit bd8617ffd9
+1 -1
View File
@@ -400,7 +400,7 @@ class WebsiteForum(http.Controller):
def users(self, forum, page=1, **searches):
User = request.env['res.users']
step = 30
tag_count = User.search_count([('karma', '>', 1), ('website_published', '=', True)])
tag_count = User.sudo().search_count([('karma', '>', 1), ('website_published', '=', True)])
pager = request.website.pager(url="/forum/%s/users" % slug(forum), total=tag_count, page=page, step=step, scope=30)
user_obj = User.sudo().search([('karma', '>', 1), ('website_published', '=', True)], limit=step, offset=pager['offset'], order='karma DESC')
# put the users in block of 3 to display them as a table