From b8efdbdf395c3f82fa6c8ea483e8fa4d77f0fd2f Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 10 Nov 2014 16:20:23 +0100 Subject: [PATCH] [FIX] website_forum: avoid access error when closing spam/abuse questions Logging the user login is not necessary, but accessing it might cause access errors. Logging the UID is equivalent anyway, so let's not bother. --- addons/website_forum/models/forum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index a9e192c8e65..4c36d68ef29 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -393,7 +393,7 @@ class Post(osv.Model): for post in self.browse(cr, uid, ids, context=context): if post.closed_reason_id.id in (reason_offensive, reason_spam): _logger.info('Upvoting user <%s>, reopening spam/offensive question', - post.create_uid.login) + post.create_uid) # TODO: in master, consider making this a tunable karma parameter self.pool['res.users'].add_karma(cr, SUPERUSER_ID, [post.create_uid.id], post.forum_id.karma_gen_question_downvote * -5, @@ -409,7 +409,7 @@ class Post(osv.Model): if reason_id in (reason_offensive, reason_spam): for post in self.browse(cr, uid, ids, context=context): _logger.info('Downvoting user <%s> for posting spam/offensive contents', - post.create_uid.login) + post.create_uid) # TODO: in master, consider making this a tunable karma parameter self.pool['res.users'].add_karma(cr, SUPERUSER_ID, [post.create_uid.id], post.forum_id.karma_gen_question_downvote * 5,