[FIX] website_forum: 404 error message for empty question

When a empty question was posted in the forum, a 404 error was raised.

opw:76940
This commit is contained in:
Goffin Simon
2017-10-16 09:53:11 +02:00
parent 945dd32eb0
commit cd21942ab8
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -322,7 +322,7 @@ class WebsiteForum(http.Controller):
if post_type == 'question' and not post.get('post_name', ''):
return request.render('website.http_error', {'status_code': _('Bad Request'), 'status_message': _('Title should not be empty.')})
if post.get('content', '') == '<p><br></p>':
return werkzeug.utils.redirect("/forum/%s/question/%s?nocontent=1" % (slug(forum), post_parent and slug(post_parent)))
return request.render('website.http_error', {'status_code': _('Bad Request'), 'status_message': _('Question should not be empty.')})
post_tag_ids = forum._tag_to_write_vals(post.get('post_tags', ''))
@@ -2471,6 +2471,12 @@ msgstr ""
msgid "Title must not be empty"
msgstr ""
#. module: website_forum
#: code:addons/website_forum/controllers/main.py:325
#, python-format
msgid "Question should not be empty."
msgstr ""
#. module: website_forum
#: code:addons/website_forum/controllers/main.py:323
#: code:addons/website_forum/controllers/main.py:394