Commit 84ba1a9f authored by Yoshinori Okuji's avatar Yoshinori Okuji

Raise a nicer error message, when the format is invalid for an item of a portal type.

Thank Mikolaj.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21381 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 84284d5b
...@@ -1701,7 +1701,10 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem): ...@@ -1701,7 +1701,10 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem):
types_tool = self.getPortalObject().portal_types types_tool = self.getPortalObject().portal_types
types_list = list(types_tool.objectIds()) types_list = list(types_tool.objectIds())
for key in self._archive.keys(): for key in self._archive.keys():
try:
portal_type, allowed_type = key.split(' | ') portal_type, allowed_type = key.split(' | ')
except ValueError:
raise ValueError('Invalid item %r in %s' % (key, self.name))
# check properties corresponds to what is defined in site # check properties corresponds to what is defined in site
if not portal_type in types_list: if not portal_type in types_list:
raise ValueError, "Portal Type %s not found in site" %(portal_type,) raise ValueError, "Portal Type %s not found in site" %(portal_type,)
......
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