Commit 37bbbe77 authored by Yusei Tahara's avatar Yusei Tahara

Fixed a bug that ProxyField.get_value raise error when proxyfield does not have template field.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16516 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f1a71e2a
...@@ -513,7 +513,10 @@ class ProxyField(ZMIField): ...@@ -513,7 +513,10 @@ class ProxyField(ZMIField):
""" """
Return a callable expression Return a callable expression
""" """
try:
tales_expr = self.get_tales_expression(id) tales_expr = self.get_tales_expression(id)
except ValueError:
return None
if tales_expr: if tales_expr:
return TALESValue(tales_expr) return TALESValue(tales_expr)
......
...@@ -130,6 +130,8 @@ class TestProxyField(unittest.TestCase): ...@@ -130,6 +130,8 @@ class TestProxyField(unittest.TestCase):
'my_title', 'Not Title', 'ProxyField') 'my_title', 'Not Title', 'ProxyField')
proxy_field = self.container.Base_view.my_title proxy_field = self.container.Base_view.my_title
self.assertEquals(None, proxy_field.getTemplateField()) self.assertEquals(None, proxy_field.getTemplateField())
self.assertEquals(None, proxy_field.get_value('enable'))
self.assertEquals(None, proxy_field.get_value('default'))
proxy_field.manage_edit_xmlrpc(dict(form_id='Base_viewProxyFieldLibrary', proxy_field.manage_edit_xmlrpc(dict(form_id='Base_viewProxyFieldLibrary',
field_id='my_title',)) field_id='my_title',))
......
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