From cd21942ab8473718a5f986f12a5d76d7f71b2909 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 12 Oct 2017 16:13:42 +0200 Subject: [PATCH] =?UTF-8?q?[FIX]=C2=A0website=5Fforum:=20404=20error=20mes?= =?UTF-8?q?sage=20for=20empty=20question?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a empty question was posted in the forum, a 404 error was raised. opw:76940 --- addons/website_forum/controllers/main.py | 2 +- addons/website_forum/i18n/website_forum.pot | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index fb21827b0fe..8ec59225e6b 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -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', '') == '


': - 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', '')) diff --git a/addons/website_forum/i18n/website_forum.pot b/addons/website_forum/i18n/website_forum.pot index 75bdf73ced2..d160e5971bb 100644 --- a/addons/website_forum/i18n/website_forum.pot +++ b/addons/website_forum/i18n/website_forum.pot @@ -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