From 2c6ea3cf45a32ae7c5b8b82123b7f022915de170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 7 Mar 2018 16:47:41 +0100 Subject: [PATCH] [REM] mail: remove deprecated controllers follow, unfollow and new Mail holds some controllers used notably in notification emails to allow some action directly from email buttons. It is used for example to redirect people to the right view when clicking on 'view document' button. Some deprecated controllers still exist in codebase but are not used anymore. The 'new' controller notably has been removed at df01742fc09989ec830c27427298a99491c9746a . The '(un)follow' controllers have been removed recently at 11d2d30e91758baaa9c6241a86f97ae3dfe52ad2 . Let us remove that dead code. --- addons/mail/controllers/main.py | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index dbf6f23e031..b9f0d8e8abc 100644 --- a/addons/mail/controllers/main.py +++ b/addons/mail/controllers/main.py @@ -191,38 +191,6 @@ class MailController(http.Controller): return self._redirect_to_record(model, res_id, access_token) - @http.route('/mail/follow', type='http', auth='user', methods=['GET']) - def mail_action_follow(self, model, res_id, token=None): - comparison, record, redirect = self._check_token_and_record_or_redirect(model, int(res_id), token) - if comparison and record: - try: - record.sudo().message_subscribe_users() - except Exception: - return self._redirect_to_messaging() - return redirect - - @http.route('/mail/unfollow', type='http', auth='user', methods=['GET']) - def mail_action_unfollow(self, model, res_id, token=None): - comparison, record, redirect = self._check_token_and_record_or_redirect(model, int(res_id), token) - if comparison and record: - try: - # TDE CHECKME: is sudo really necessary ? - record.sudo().message_unsubscribe_users([request.uid]) - except Exception: - return self._redirect_to_messaging() - return redirect - - @http.route('/mail/new', type='http', auth='user') - def mail_action_new(self, model, res_id, action_id): - # TDE NOTE: this controller is deprecated and will disappear before v11. - if model not in request.env: - return self._redirect_to_messaging() - params = {'view_type': 'form', 'model': model} - if action_id: - # Probably something to do - params['action'] = action_id - return werkzeug.utils.redirect('/web?#%s' % url_encode(params)) - @http.route('/mail/assign', type='http', auth='user', methods=['GET']) def mail_action_assign(self, model, res_id, token=None): comparison, record, redirect = self._check_token_and_record_or_redirect(model, int(res_id), token)