summaryrefslogtreecommitdiff
path: root/addons/website_forum/controllers/main.py
diff options
context:
space:
mode:
authorHiral Bhavsar <hbh@odoo.com>2018-01-25 15:19:32 +0530
committerJeremy Kersten <jke@odoo.com>2018-04-09 21:57:43 +0200
commit5cafed7fab4492211e9aa32daa5f55e73f3e8390 (patch)
treea7a36cae885e2be3b83b7d4a3abf9be8c8436302 /addons/website_forum/controllers/main.py
parentbae90d81df7fa0bd229ac042d58ec5a8e4e2bb3b (diff)
[IMP] website_forum: better management of archived forum
Before this commit, badge, user,... was available when a forum is archived. Now we display a msg to explain to the user that the forum has been archived. Related to task-33955
Diffstat (limited to 'addons/website_forum/controllers/main.py')
-rw-r--r--addons/website_forum/controllers/main.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py
index ac84166d528..4e493e5017e 100644
--- a/addons/website_forum/controllers/main.py
+++ b/addons/website_forum/controllers/main.py
@@ -234,6 +234,9 @@ class WebsiteForum(http.Controller):
@http.route(['''/forum/<model("forum.forum"):forum>/question/<model("forum.post", "[('forum_id','=',forum[0]),('parent_id','=',False),('can_view', '=', True)]"):question>'''], type='http', auth="public", website=True)
def question(self, forum, question, **post):
+ if not forum.active:
+ return request.render("website_forum.header", {'forum': forum})
+
# Hide posts from abusers (negative karma), except for moderators
if not question.can_view:
raise werkzeug.exceptions.NotFound()