[FIX] website_forum: fix permissions for tag notifs

Forum users can follow tags and will be notified when a new post
includes the tag. However the person posting it does not have access to
the list of followers, so the notification would fail with an
AccessError. The OP would get a 403 page and the post would not be
posted.

closes odoo/odoo#47907

X-original-commit: 2b2b8484cefc4b2cfdf1023fb8209e70eef5ec24
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Olivier Dony
2020-03-18 11:53:38 +00:00
parent b47aa1b005
commit 5f4ac9ea6d
+1 -1
View File
@@ -533,7 +533,7 @@ class Post(models.Model):
def post_notification(self):
for post in self:
tag_partners = post.tag_ids.mapped('message_partner_ids')
tag_partners = post.tag_ids.sudo().mapped('message_partner_ids')
if post.state == 'active' and post.parent_id:
post.parent_id.message_post_with_view(