[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
This commit is contained in:
Jeremy Kersten
2019-01-23 17:03:04 +00:00
parent 7805c55b0c
commit 1e1ea00e66
+2 -1
View File
@@ -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):