[FIX] gettextAlias: handle the case when context is None

lp bug: https://launchpad.net/bugs/327510 fixed

bzr revid: christophe@tinyerp.com-20090210094843-khwkfjd83fha8rvl
This commit is contained in:
Christophe Simonis
2009-02-10 10:48:43 +01:00
parent b13793ea9d
commit 4d3713a045
+1 -1
View File
@@ -59,7 +59,7 @@ class GettextAlias(object):
def __call__(self, source):
frame = inspect.stack()[1][0]
cr = frame.f_locals.get('cr')
lang = frame.f_locals.get('context', {}).get('lang', False)
lang = (frame.f_locals.get('context') or {}).get('lang', False)
if not (lang and cr):
return source