diff options
| author | Sébastien Theys <seb@odoo.com> | 2019-04-23 07:07:57 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2019-04-23 07:07:57 +0000 |
| commit | af02d1da58db9805eb63d495c8ff1eb8e5d6f902 (patch) | |
| tree | 87fddd7fc466945c513907da4232eb08d109661a /addons | |
| parent | b09d20ab29a13e1b6c851b67beb81bcf0dbd7d42 (diff) | |
[FIX] website_forum: remove unnecessary slow code
Since commit 56645335b7bae0415242ec51193e493119a58879
the subtype `gamification.mt_badge_granted` is not used anymore. Therefore
this method will never return anything.
However, it is very costly on performance, and it is run on every page of the
forum! The problematic performance point is that `needaction` is a computed
field, which implies all existing `mail.message` having the target subtype have
to be fetched to compute this field, which obviously does not scale well at all.
closes odoo/odoo#32861
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website_forum/controllers/main.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index ac84166d528..221128b2ab0 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -22,12 +22,8 @@ class WebsiteForum(http.Controller): _user_per_page = 30 def _get_notifications(self): - badge_subtype = request.env.ref('gamification.mt_badge_granted') - if badge_subtype: - msg = request.env['mail.message'].search([('subtype_id', '=', badge_subtype.id), ('needaction', '=', True)]) - else: - msg = list() - return msg + """Deprecated""" + return list() def _prepare_forum_values(self, forum=None, **kwargs): values = { |
