Skip to content
Snippets Groups Projects
Commit 01f70115 authored by Jeremy Kersten's avatar Jeremy Kersten
Browse files

[FIX] Forum - Redirect permanently to the question, if post_id in url is not an answer.

parent c1378cc1
No related branches found
No related tags found
No related merge requests found
......@@ -214,6 +214,10 @@ class WebsiteForum(http.Controller):
# increment view counter
request.registry['forum.post'].set_viewed(cr, SUPERUSER_ID, [question.id], context=context)
if question.parent_id:
redirect_url = "/forum/%s/question/%s" % (slug(forum), slug(question.parent_id))
return werkzeug.utils.redirect(redirect_url, 301)
filters = 'question'
values = self._prepare_forum_values(forum=forum, searches=post)
values.update({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment