[FIX] website_forum: Use sudo to send new question notification
Otherwise portal users can not access to some partners subscribed to the forum. Closes #9855
This commit is contained in:
@@ -492,7 +492,7 @@ class Post(models.Model):
|
||||
elif post.state == 'pending' and not post.parent_id:
|
||||
# TDE FIXME: in master, you should probably use a subtype;
|
||||
# however here we remove subtype but set partner_ids
|
||||
partners = post.message_partner_ids.filtered(lambda partner: partner.user_ids and partner.user_ids.karma >= post.forum_id.karma_moderate)
|
||||
partners = post.sudo().message_partner_ids.filtered(lambda partner: partner.user_ids and partner.user_ids.karma >= post.forum_id.karma_moderate)
|
||||
note_subtype = self.sudo().env.ref('mail.mt_note')
|
||||
body = _(
|
||||
'<p>A new question <i>%s</i> has been asked on %s and require your validation. <a href="%s/forum/%s/question/%s">Click here to access the question.</a></p>' %
|
||||
|
||||
Reference in New Issue
Block a user