Commit b222c538 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

we cache cloned Expressions because original ones are persistent objects.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29733 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 04b1cfb0
......@@ -179,15 +179,26 @@ class ActionInformation(XMLObject):
def getRawActionInformation(self):
"""Return RawActionInformation instance that is not persistent and
is cacheable."""
# we cache cloned Expressions because original ones are persistent
# objects.
icon = self.getIcon()
if icon is not None:
icon = Expression(icon.text)
action = self.getAction()
if action is not None:
action = Expression(action.text)
condition = self.getCondition()
if condition is not None:
condition = Expression(condition.text)
return RawActionInformation(
{'id':self.getReference(),
'name':self.getTitle(),
'description':self.getDescription(),
'category':self.getActionType(),
'priority':self.getFloatIndex(),
'icon':self.getIcon(),
'action':self.getAction(),
'condition':self.getCondition(),
'icon':icon,
'action':action,
'condition':condition,
'action_permission':self.getActionPermissionList(),
}
)
......
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