diff options
| author | Jeremy Kersten <jke@odoo.com> | 2019-01-23 16:39:41 +0000 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2019-01-23 17:03:04 +0000 |
| commit | 1e1ea00e66686d76a36fa0c19c3e4865e3161031 (patch) | |
| tree | e902eed4aee74128b1fa524e2bf9301e283fb69f /addons/website_forum/controllers | |
| parent | 7805c55b0c9db68ba13517af365ed94b0f04f1e0 (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/website_forum/controllers')
| -rw-r--r-- | addons/website_forum/controllers/main.py | 3 |
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): |
