Commit af519422 authored by Vincent Pelletier's avatar Vincent Pelletier

obj will not be None here.

It's tested earlier in the same method.
parent 97efb118
...@@ -2275,28 +2275,24 @@ class ListBoxRendererLine: ...@@ -2275,28 +2275,24 @@ class ListBoxRendererLine:
original_value = getattr(brain, alias) original_value = getattr(brain, alias)
processed_value = original_value processed_value = original_value
else: else:
if obj is not None: try:
# Get the trailing part.
try: try:
# Get the trailing part. property_id = sql[sql.rindex('.') + 1:]
try: except ValueError:
property_id = sql[sql.rindex('.') + 1:] property_id = sql
except ValueError:
property_id = sql
try: try:
original_value = obj.getProperty(property_id, _marker) original_value = obj.getProperty(property_id, _marker)
if original_value is _marker: if original_value is _marker:
raise AttributeError, property_id raise AttributeError, property_id
processed_value = original_value processed_value = original_value
except AttributeError: except AttributeError:
original_value = getattr(obj, property_id, None) original_value = getattr(obj, property_id, None)
processed_value = original_value processed_value = original_value
except (AttributeError, KeyError, Unauthorized): except (AttributeError, KeyError, Unauthorized):
original_value = None
processed_value = 'Could not evaluate %s' % property_id
else:
original_value = None original_value = None
processed_value = 'Object does not exist' processed_value = 'Could not evaluate %s' % property_id
# If the value is callable, evaluate it. # If the value is callable, evaluate it.
if callable(original_value): if callable(original_value):
......
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