[FIX] website_forum: notification of comments like answers

Fixes #12096
This commit is contained in:
Martin Trigaux
2016-05-27 11:30:40 +02:00
parent 5da59c248b
commit e32ba845de
+3 -1
View File
@@ -336,8 +336,10 @@ class WebsiteForum(http.Controller):
question = post.parent_id if post.parent_id else post
if kwargs.get('comment') and post.forum_id.id == forum.id:
# TDE FIXME: check that post_id is the question or one of its answers
body = _('<p>A new answer for <i>%s</i> has been posted. <a href="%s/forum/%s/question/%s">Click here to access the post.</a></p>') % \
(question.name, base_url, slug(question.forum_id), slug(question))
post.with_context(mail_create_nosubscribe=True).message_post(
body=kwargs.get('comment'),
body=body,
message_type='comment',
subtype='mt_comment')
return werkzeug.utils.redirect("/forum/%s/question/%s" % (slug(forum), slug(question)))