Commit 2a92c4e1 authored by Arnaud Fontaine's avatar Arnaud Fontaine

createExpressionContext() already stores the result of Expression

evaluation in a transactional variable


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43958 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a29aa7ba
...@@ -303,7 +303,7 @@ def getAccessorHolderList(site, portal_type_name, property_sheet_value_list): ...@@ -303,7 +303,7 @@ def getAccessorHolderList(site, portal_type_name, property_sheet_value_list):
import erp5.accessor_holder import erp5.accessor_holder
accessor_holder_list = [] accessor_holder_list = []
tv = getTransactionalVariable() expression_context = None
for property_sheet in property_sheet_value_list: for property_sheet in property_sheet_value_list:
# LOG("ERP5Type.dynamic", INFO, # LOG("ERP5Type.dynamic", INFO,
...@@ -322,11 +322,8 @@ def getAccessorHolderList(site, portal_type_name, property_sheet_value_list): ...@@ -322,11 +322,8 @@ def getAccessorHolderList(site, portal_type_name, property_sheet_value_list):
property_sheet_name)) property_sheet_name))
except AttributeError: except AttributeError:
# lazily create the context, only if needed. # lazily create the context, only if needed.
try: if expression_context is None:
expression_context = tv['accessor_holder_expression_context']
except KeyError:
expression_context = createExpressionContext(site) expression_context = createExpressionContext(site)
tv['accessor_holder_expression_context'] = expression_context
# Generate the accessor holder as it has not been done yet # Generate the accessor holder as it has not been done yet
accessor_holder_class = property_sheet.createAccessorHolder( accessor_holder_class = property_sheet.createAccessorHolder(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment