Commit ca50790a authored by Arnaud Fontaine's avatar Arnaud Fontaine

Do not fail to migrate a filesystem Property Sheet to ZODB if some

constraints have not been migrated yet, just ignore them for now


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42938 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 54955290
...@@ -39,7 +39,7 @@ from Products.CMFCore.Expression import Expression ...@@ -39,7 +39,7 @@ from Products.CMFCore.Expression import Expression
from Products.ERP5Type.dynamic.accessor_holder import AccessorHolderType from Products.ERP5Type.dynamic.accessor_holder import AccessorHolderType
from zLOG import LOG, ERROR, INFO from zLOG import LOG, ERROR, INFO, WARNING
class PropertySheetTool(BaseTool): class PropertySheetTool(BaseTool):
""" """
...@@ -146,7 +146,18 @@ class PropertySheetTool(BaseTool): ...@@ -146,7 +146,18 @@ class PropertySheetTool(BaseTool):
portal_type_dict.update(self._merged_portal_type_dict) portal_type_dict.update(self._merged_portal_type_dict)
for constraint in getattr(klass, '_constraints', ()): for constraint in getattr(klass, '_constraints', ()):
try:
portal_type = portal_type_dict[constraint['type']] portal_type = portal_type_dict[constraint['type']]
except KeyError:
# TODO: Constraints without Portal Type yet (e.g. Constraints
# which have not been migrated yet (within BTs or per-project
# Products)) are simply *ignored* for now
LOG("Tool.PropertySheetTool", WARNING,
"Not migrating constraint %s to portal_property_sheets" % \
constraint['type'])
continue
portal_type_class = types_tool.getPortalTypeClass(portal_type) portal_type_class = types_tool.getPortalTypeClass(portal_type)
# Create the new constraint # Create the new constraint
......
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