From 66ba3092cf2fdd3a768ad072df90d2d6c84e67a8 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 18 Apr 2014 13:55:56 +0200 Subject: [PATCH] [FIX] http: correct detection of old (v7) routes that still take "req" as first argument bzr revid: chs@openerp.com-20140418115556-717tlcwejszmi0lb --- openerp/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/http.py b/openerp/http.py index 8d7497fc40d..c9181d2c211 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -600,8 +600,8 @@ class ControllerType(type): # flag old-style methods with req as first argument for k, v in attrs.items(): - if inspect.isfunction(v): - spec = inspect.getargspec(v) + if inspect.isfunction(v) and hasattr(v, 'original_func'): + spec = inspect.getargspec(v.original_func) first_arg = spec.args[1] if len(spec.args) >= 2 else None if first_arg in ["req", "request"]: v._first_arg_is_req = True