Fix IrHttp._dispatch is now a class method

This commit is contained in:
Guewen Baconnier
2016-12-21 23:21:57 +01:00
parent 8e4b461c75
commit 4eecb899f3
+5 -4
View File
@@ -11,13 +11,14 @@ from ..statsd_client import statsd, customer, environment
class IrHttp(models.AbstractModel): class IrHttp(models.AbstractModel):
_inherit = 'ir.http' _inherit = 'ir.http'
def _dispatch(self): @classmethod
def _dispatch(cls):
if not statsd: if not statsd:
return super(IrHttp, self)._dispatch() return super(IrHttp, cls)._dispatch()
path_info = request.httprequest.environ.get('PATH_INFO') path_info = request.httprequest.environ.get('PATH_INFO')
if path_info.startswith('/longpolling/'): if path_info.startswith('/longpolling/'):
return super(IrHttp, self)._dispatch() return super(IrHttp, cls)._dispatch()
parts = ['http', ] parts = ['http', ]
if path_info.startswith('/web/dataset/call_button'): if path_info.startswith('/web/dataset/call_button'):
@@ -38,4 +39,4 @@ class IrHttp(models.AbstractModel):
] ]
with statsd.timer('.'.join(parts)): with statsd.timer('.'.join(parts)):
return super(IrHttp, self)._dispatch() return super(IrHttp, cls)._dispatch()