Commit 0504f56c authored by Rafael Monnerat's avatar Rafael Monnerat

Ignore portal types that not exist or empty lines

parent 21795ffe
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
############################################################################## ##############################################################################
import zope.interface import zope.interface
from zLOG import LOG, INFO
from Acquisition import aq_base from Acquisition import aq_base
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
...@@ -33,6 +34,7 @@ from Products.ERP5Type.XMLObject import XMLObject ...@@ -33,6 +34,7 @@ from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
class PortalTypeRolesSpreadsheetConfiguratorItem(ConfiguratorItemMixin, XMLObject): class PortalTypeRolesSpreadsheetConfiguratorItem(ConfiguratorItemMixin, XMLObject):
"""Import a portal type roles spreadsheet. """Import a portal type roles spreadsheet.
""" """
...@@ -63,6 +65,10 @@ class PortalTypeRolesSpreadsheetConfiguratorItem(ConfiguratorItemMixin, XMLObjec ...@@ -63,6 +65,10 @@ class PortalTypeRolesSpreadsheetConfiguratorItem(ConfiguratorItemMixin, XMLObjec
self._readSpreadSheet() self._readSpreadSheet()
for type_name, role_list in self._spreadsheet_cache.items(): for type_name, role_list in self._spreadsheet_cache.items():
portal_type = portal.portal_types.getTypeInfo(type_name) portal_type = portal.portal_types.getTypeInfo(type_name)
if portal_type is None:
LOG("CONFIGURATOR", INFO, "Fail to define Roles for %s" % portal_type)
continue
for role in role_list: for role in role_list:
# rebuild a category from Group / Site & Function # rebuild a category from Group / Site & Function
category_list = [] category_list = []
......
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