[FIX] mail: use @route decorator for routes

bzr revid: chs@openerp.com-20131015153631-18pdi1xzk84kg1y2
This commit is contained in:
Christophe Simonis 2013-10-15 17:36:31 +02:00
parent f42b33100d
commit b2c74f5f42
1 changed files with 3 additions and 2 deletions

View File

@ -10,8 +10,9 @@ from openerp.addons.web.controllers.main import content_disposition
class MailController(http.Controller):
_cp_path = '/mail'
@http.httprequest
@http.route('/mail/download_attachment', type='http', auth='user')
def download_attachment(self, req, model, id, method, attachment_id, **kw):
# FIXME use /web/binary/saveas directly
Model = req.session.model(model)
res = getattr(Model, method)(int(id), int(attachment_id))
if res:
@ -23,7 +24,7 @@ class MailController(http.Controller):
('Content-Disposition', content_disposition(filename, req))])
return req.not_found()
@http.jsonrequest
@http.route('/mail/receive', type='json', auth='none')
def receive(self, req):
""" End-point to receive mail from an external SMTP server. """
dbs = req.jsonrequest.get('databases')