[FIX] service: wrapper: fixed context fetching. Indeed call_kw set its context

in kwargs of kwargs, leading to a kwargception.

bzr revid: tde@openerp.com-20140507110637-qlj1rj8lrcpkejf6
This commit is contained in:
Thibault Delavallée 2014-05-07 13:06:37 +02:00
parent b882dd7109
commit 0f9917c9a3
1 changed files with 2 additions and 1 deletions

View File

@ -54,7 +54,8 @@ def check(f):
if args and isinstance(args[-1], dict):
ctx = args[-1]
elif isinstance(kwargs, dict):
ctx = kwargs.get('context', {})
# kwargception because call_kw set its context in kwargs['kwargs']
ctx = kwargs.get('context', kwargs.get('kwargs', {}).get('context', {}))
uid = 1
if args and isinstance(args[0], (long, int)):