[FIX] http: correct detection of old (v7) routes that still take "req" as first argument

bzr revid: chs@openerp.com-20140418115556-717tlcwejszmi0lb
This commit is contained in:
Christophe Simonis 2014-04-18 13:55:56 +02:00
parent 6f4efd45bb
commit 66ba3092cf
1 changed files with 2 additions and 2 deletions

View File

@ -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