Commit 0ae40c64 authored by Julien Muchembled's avatar Julien Muchembled

Small optimization

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32415 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 742a957d
...@@ -176,14 +176,15 @@ class TALESValue(StaticValue): ...@@ -176,14 +176,15 @@ class TALESValue(StaticValue):
# This allows to pass some pointer to the local object # This allows to pass some pointer to the local object
# through the REQUEST parameter. Not very clean. # through the REQUEST parameter. Not very clean.
# Used by ListBox to render different items in a list # Used by ListBox to render different items in a list
if kw.get('REQUEST', None) is not None and kw.get('cell', None) is None: if kw.get('cell') is None:
if getattr(kw['REQUEST'], 'cell', None) is not None: request = kw.get('REQUEST')
kw['cell'] = getattr(kw['REQUEST'], 'cell') if request is not None:
if getattr(request, 'cell', None) is not None:
kw['cell'] = request.cell
else: else:
kw['cell'] = kw['REQUEST'] kw['cell'] = request
elif kw.get('cell', None) is None: elif getattr(REQUEST, 'cell', None) is not None:
if getattr(REQUEST, 'cell', None) is not None: kw['cell'] = REQUEST.cell
kw['cell'] = getattr(REQUEST, 'cell')
# on Zope 2.12, only path expressions can access the CONTEXTS name # on Zope 2.12, only path expressions can access the CONTEXTS name
# but ERP5 has many python expressions that try to access CONTEXTS, so # but ERP5 has many python expressions that try to access CONTEXTS, so
# we try to keep backward compatibility # we try to keep backward compatibility
......
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