[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user