From e26d23cb971757787238d05ffaad34619c886dde Mon Sep 17 00:00:00 2001 From: fja-odoo Date: Tue, 11 Jun 2019 12:27:01 +0000 Subject: [PATCH] [FIX] website_forum: remove unused close notif event This code was not used properly and was triggering useless rpc. This code was used in the deprecated badge system and we forgot to remove it. Commit where the code should have been removed: ec212de5c7a7b0f4b74549add62a2988f5b38ee6 Commit where a quick fix was made: 1e1ea00e66686d76a36fa0c19c3e4865e3161031 --- addons/website_forum/controllers/main.py | 6 ------ .../static/src/js/website_forum.js | 17 ----------------- 2 files changed, 23 deletions(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index 86ce6993a90..272e119f94c 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -59,12 +59,6 @@ class WebsiteForum(WebsiteProfile): }) return "/forum/%s" % slug(forum_id) - @http.route('/forum/notification_read', type='json', auth="user", methods=['POST'], website=True) - def notification_read(self, **kwargs): - 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): Forum = env['forum.forum'] dom = sitemap_qs2dom(qs, '/forum', Forum._rec_name) diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 1557d6fd50f..51cae0cc28f 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -30,7 +30,6 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({ 'click .accept_answer:not(.karma_required)': '_onAcceptAnswerClick', 'click .favourite_question': '_onFavoriteQuestionClick', 'click .comment_delete': '_onDeleteCommentClick', - 'click .notification_close': '_onCloseNotificationClick', 'click .js_close_intro': '_onCloseIntroClick', }, @@ -451,22 +450,6 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({ $link.parents('.comment').first().remove(); }); }, - /** - * @private - * @param {Event} ev - */ - _onCloseNotificationClick: function (ev) { - if (!session.is_website_user) { - ev.preventDefault(); - var $link = $(ev.currentTarget); - this._rpc({ - route: '/forum/notification_read', - params: { - notification_id: $link.attr('id'), - }, - }); - } - }, /** * @private * @param {Event} ev