[FIX] website_forum: fixed setting an answer as valid / invalid. The change
in the behavior of browse records due to the new API introduced a wrong behavior, now fixed.
This commit is contained in:
parent
73fc6419a9
commit
10741e2799
|
@ -315,9 +315,9 @@ class WebsiteForum(http.Controller):
|
|||
return {'error': 'anonymous_user'}
|
||||
|
||||
# set all answers to False, only one can be accepted
|
||||
request.registry['forum.post'].write(cr, uid, [c.id for c in post.parent_id.child_ids], {'is_correct': False}, context=context)
|
||||
request.registry['forum.post'].write(cr, uid, [c.id for c in post.parent_id.child_ids if not c.id == post.id], {'is_correct': False}, context=context)
|
||||
request.registry['forum.post'].write(cr, uid, [post.id], {'is_correct': not post.is_correct}, context=context)
|
||||
return not post.is_correct
|
||||
return post.is_correct
|
||||
|
||||
@http.route('/forum/<model("forum.forum"):forum>/post/<model("forum.post"):post>/delete', type='http', auth="user", methods=['POST'], website=True)
|
||||
def post_delete(self, forum, post, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue