Commit fa3e5fe1 authored by Nicolas Dumazet's avatar Nicolas Dumazet

remove two useless tests

first case: obj is never modified between "obj = None" and this line
second case: (not tales) => (obj==None) 


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31810 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 079dbc9e
...@@ -2114,14 +2114,14 @@ class ListBoxRendererLine: ...@@ -2114,14 +2114,14 @@ class ListBoxRendererLine:
if editable_field is not None: if editable_field is not None:
tales = editable_field.tales.get('default', '') tales = editable_field.tales.get('default', '')
if tales: if tales:
if obj is None: obj = self.getObject() obj = self.getObject()
original_value = editable_field.__of__(obj).get_value('default', original_value = editable_field.__of__(obj).get_value('default',
cell=brain) cell=brain)
processed_value = original_value processed_value = original_value
# If a tales expression is not defined, get a skin, an accessor or a property. # If a tales expression is not defined, get a skin, an accessor or a property.
if not tales: if not tales:
if (obj is None or brain is not obj) and getattr(aq_self(brain), alias, None) is not None: if getattr(aq_self(brain), alias, None) is not None:
original_value = getattr(brain, alias) original_value = getattr(brain, alias)
processed_value = original_value processed_value = original_value
else: else:
......
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