summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2019-01-23 16:39:41 +0000
committerJeremy Kersten <jke@odoo.com>2019-01-23 17:03:04 +0000
commit1e1ea00e66686d76a36fa0c19c3e4865e3161031 (patch)
treee902eed4aee74128b1fa524e2bf9301e283fb69f /addons
parent7805c55b0c9db68ba13517af365ed94b0f04f1e0 (diff)
[FIX] website_forum: avoid traceback on ack notif
Before this commit, notification_read raise a traceback on some button click. Eg: Flag/unglaG It was hidden in the console, but we can just avoid it too closes odoo/odoo#30524
Diffstat (limited to 'addons')
-rw-r--r--addons/website_forum/controllers/main.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py
index c23a2652b7f..cf3352276c0 100644
--- a/addons/website_forum/controllers/main.py
+++ b/addons/website_forum/controllers/main.py
@@ -100,7 +100,8 @@ class WebsiteForum(http.Controller):
@http.route('/forum/notification_read', type='json', auth="user", methods=['POST'], website=True)
def notification_read(self, **kwargs):
- request.env['mail.message'].browse([int(kwargs.get('notification_id'))]).set_message_done()
+ if kwargs.get('notification_id'):
+ request.env['mail.message'].browse([int(kwargs.get('notification_id'))]).set_message_done()
return True
def sitemap_forum(env, rule, qs):