Commit f8f26a04 authored by Rafael Monnerat's avatar Rafael Monnerat

Ignore and log if bt is not defined.

parent e1394fc6
......@@ -83,7 +83,8 @@ class PortalTypeRolesSpreadsheetConfiguratorItem(ConfiguratorItemMixin, XMLObjec
## Update BT5
bt5_obj = business_configuration.getSpecialiseValue()
bt5_obj.edit(template_portal_type_roles_list=self._spreadsheet_cache.keys())
if bt5_obj is not None:
bt5_obj.edit(template_portal_type_roles_list=self._spreadsheet_cache.keys())
def checkSpreadSheetConsistency(self):
"""Check that the spread sheet is consistent with categories spreadsheet.
......
......@@ -36,10 +36,17 @@ class ConfiguratorItemMixin:
def install(self, document, business_configuration, prefix=''):
""" Add object to customer customization template. """
bt5_obj = business_configuration.getSpecialiseValue()
if bt5_obj is None:
LOG('ConfiguratorItem', INFO,
'Unable to find related business template to %s' % \
business_configuration.getRelativeUrl())
return
if document.getPortalType() in ['Category', 'Base Category']:
prefix = "portal_categories/"
template_path_list = ['%s%s' % (prefix, document.getRelativeUrl()),
'%s%s/**' % (prefix, document.getRelativeUrl())]
current_template_path_list = list(bt5_obj.getTemplatePathList())
current_template_path_list.extend(template_path_list)
bt5_obj.edit(template_path_list=current_template_path_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