diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py
index 7dbac19620a..94b5f684879 100644
--- a/addons/website_forum/controllers/main.py
+++ b/addons/website_forum/controllers/main.py
@@ -317,8 +317,11 @@ class WebsiteForum(http.Controller):
'/forum///reply'],
type='http', auth="user", methods=['POST'], website=True)
def post_create(self, forum, post_parent=None, post_type=None, **post):
- if post_type == 'question' and not post.get('post_name', '').strip():
+ if post_type == 'question' and not post.get('post_name', ''):
return request.website.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)))
+
post_tag_ids = forum._tag_to_write_vals(post.get('post_tags', ''))
new_question = request.env['forum.post'].create({
'forum_id': forum.id,
diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml
index ab29205ea40..5e5dea85da1 100644
--- a/addons/website_forum/views/website_forum.xml
+++ b/addons/website_forum/views/website_forum.xml
@@ -690,6 +690,9 @@
- no need to answer the same question twice. Also, please don't forget to vote
- it really helps to select the best questions and answers!
+
+ You cannot post an empty answer
+