[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 df01742fc0 .
The '(un)follow' controllers have been removed recently at 11d2d30e91 .
Let us remove that dead code.
This commit is contained in:
Thibault Delavallée
2018-03-14 11:05:11 +01:00
parent a1870d9688
commit 2c6ea3cf45
-32
View File
@@ -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)