From 1e1ea00e66686d76a36fa0c19c3e4865e3161031 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 23 Jan 2019 16:39:41 +0000 Subject: [PATCH] [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 --- addons/website_forum/controllers/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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):