Commit 98506bf0 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Do not use _v_erp5_transactional_variable, because there is no need to attach...

Do not use _v_erp5_transactional_variable, because there is no need to attach a transaction manager to ZODB.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15551 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent de968e3b
......@@ -85,12 +85,9 @@ transactional_variable_pool = local()
def getTransactionalVariable(context):
"""Return a transactional variable."""
portal = context.portal_url.getPortalObject()
try:
instance = transactional_variable_pool.instance
if getattr(portal, '_v_erp5_transactional_variable', None) is not instance:
portal._v_erp5_transactional_variable = instance
return instance
return transactional_variable_pool.instance
except AttributeError:
transactional_variable_pool.instance = TransactionalVariable()
return getTransactionalVariable(context)
tv = TransactionalVariable()
transactional_variable_pool.instance = tv
return tv
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