From f90485b56201eed7af31bb68c92c8e39b3eeaec6 Mon Sep 17 00:00:00 2001 From: Yoshinori Okuji <yo@nexedi.com> Date: Wed, 7 May 2008 06:58:56 +0000 Subject: [PATCH] Make the portal parameter optional for compatibility. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20890 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/Utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/product/ERP5Type/Utils.py b/product/ERP5Type/Utils.py index 1bcb22da55..2ef40914a6 100644 --- a/product/ERP5Type/Utils.py +++ b/product/ERP5Type/Utils.py @@ -999,10 +999,13 @@ def setDefaultConstructor(klass): document_constructor.__name__ = document_constructor_name -def createExpressionContext(object, portal): +def createExpressionContext(object, portal=None): """ Return a context used for evaluating a TALES expression. """ + if portal is None and object is not None: + portal = object.getPortalObject() + if object is None or getattr(object, 'aq_base', None) is None: folder = portal else: -- 2.30.9