[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:
ec212de5c7

Commit where a quick fix was made:
1e1ea00e66
This commit is contained in:
fja-odoo
2019-06-28 08:53:53 +00:00
parent 283f8fed6e
commit e26d23cb97
2 changed files with 0 additions and 23 deletions
-6
View File
@@ -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)
@@ -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