Commit 04858648 authored by Yusei Tahara's avatar Yusei Tahara

Prevent KeyError if type information does not exist in type tool.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18230 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5f70f941
......@@ -101,12 +101,16 @@ class PropertyTranslationDomainGetter(Method):
ptype_domain = None
ptype = instance.getPortalType()
ptypes_tool = instance.getPortalObject()['portal_types']
domain_dict = ptypes_tool[ptype].getPropertyTranslationDomainDict()
domain = domain_dict.get(self._original_key)
if domain is None:
typeinfo = ptypes_tool.getTypeInfo(ptype)
if typeinfo is None:
ptype_domain = ''
else:
ptype_domain = domain.getDomainName()
domain_dict = typeinfo.getPropertyTranslationDomainDict()
domain = domain_dict.get(self._original_key)
if domain is None:
ptype_domain = ''
else:
ptype_domain = domain.getDomainName()
if ptype_domain is '' and default is not None:
# then get the default property defined on property sheet
value = default
......
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