diff options
| author | len-odoo <len@odoo.com> | 2018-07-17 13:45:23 +0200 |
|---|---|---|
| committer | len-odoo <35492570+len-odoo@users.noreply.github.com> | 2018-07-17 15:27:35 +0200 |
| commit | a3fd6a2072020f8be41ab76986bc04c1a298528d (patch) | |
| tree | 76db38078bc37f43f6943293e91094c2b76ff6ce /addons | |
| parent | 13e321325b9c09f525dcd89e1ba27eb37bb3ac8f (diff) | |
[FIX] web_forum: fix the comparison of tags ids
When checking if tags had changed, a missing .ids made it that a recordset was
compared to a set of ids (integers).
As a result, to make an edit the forum would always check that the user had
sufficent karma to retag, even if it was not needed.
opw 1866019
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website_forum/models/forum.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index ebe6bd80b2d..8bbf4717a70 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -502,7 +502,7 @@ class Post(models.Model): self.env.user.sudo().add_karma(post.forum_id.karma_gen_answer_accept * mult) if 'tag_ids' in vals: tag_ids = set(tag.get('id') for tag in self.resolve_2many_commands('tag_ids', vals['tag_ids'])) - if any(set(post.tag_ids) != tag_ids for post in self) and any(self.env.user.karma < post.forum_id.karma_edit_retag for post in self): + if any(set(post.tag_ids.ids) != tag_ids for post in self) and any(self.env.user.karma < post.forum_id.karma_edit_retag for post in self): raise KarmaError(_('Not enough karma to retag.')) if any(key not in trusted_keys for key in vals) and any(not post.can_edit for post in self): raise KarmaError('Not enough karma to edit a post.') |
