[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:
parent
6f4efd45bb
commit
66ba3092cf
|
@ -600,8 +600,8 @@ class ControllerType(type):
|
||||||
|
|
||||||
# flag old-style methods with req as first argument
|
# flag old-style methods with req as first argument
|
||||||
for k, v in attrs.items():
|
for k, v in attrs.items():
|
||||||
if inspect.isfunction(v):
|
if inspect.isfunction(v) and hasattr(v, 'original_func'):
|
||||||
spec = inspect.getargspec(v)
|
spec = inspect.getargspec(v.original_func)
|
||||||
first_arg = spec.args[1] if len(spec.args) >= 2 else None
|
first_arg = spec.args[1] if len(spec.args) >= 2 else None
|
||||||
if first_arg in ["req", "request"]:
|
if first_arg in ["req", "request"]:
|
||||||
v._first_arg_is_req = True
|
v._first_arg_is_req = True
|
||||||
|
|
Loading…
Reference in New Issue