Skip to content

Commit

Permalink
[FIX] website_forum: fix permissions for tag notifs
Browse files Browse the repository at this point in the history
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#47856

Signed-off-by: Nicolas Martinelli (nim) <[email protected]>
  • Loading branch information
odony committed Mar 17, 2020
1 parent 65d709c commit 2b2b848
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/website_forum/models/forum.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def write(self, vals):

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(
Expand Down

0 comments on commit 2b2b848

Please sign in to comment.