Commit 9312ac1a authored by Jérome Perrin's avatar Jérome Perrin

covert to list to prevent calling remove on a tuple


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5479 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9fcb84cf
...@@ -1259,7 +1259,7 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem): ...@@ -1259,7 +1259,7 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem):
if installed_bt._objects.has_key(path): if installed_bt._objects.has_key(path):
# compare object to see it there is changes # compare object to see it there is changes
new_object = self._objects[path] new_object = self._objects[path]
old_object = installed_bt._objects[path] old_object = installed_bt._objects[path]
if new_object != old_object: if new_object != old_object:
modified_object_list.update({path : ['Modified', self.__class__.__name__[:-12]]}) modified_object_list.update({path : ['Modified', self.__class__.__name__[:-12]]})
else: # new object else: # new object
...@@ -1307,8 +1307,8 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem): ...@@ -1307,8 +1307,8 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem):
# merge differences between portal types properties # merge differences between portal types properties
# only add new, do not remove # only add new, do not remove
for id in object_property_list: for id in object_property_list:
if id not in property_list: if id not in property_list:
property_list.append(id) property_list.append(id)
setattr(portal_type, self.class_property, list(property_list)) setattr(portal_type, self.class_property, list(property_list))
def uninstall(self, context, **kw): def uninstall(self, context, **kw):
...@@ -1327,10 +1327,11 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem): ...@@ -1327,10 +1327,11 @@ class PortalTypeAllowedContentTypeTemplateItem(BaseTemplateItem):
LOG("portal types not found : ", 100, portal_id) LOG("portal types not found : ", 100, portal_id)
continue continue
property_list = self._objects[key] property_list = self._objects[key]
original_property_list = getattr(portal_type, self.class_property, ()) original_property_list = list(getattr(portal_type,
self.class_property, ()))
for id in property_list: for id in property_list:
if id in original_property_list: if id in original_property_list:
original_property_list.remove(id) original_property_list.remove(id)
setattr(portal_type, self.class_property, list(original_property_list)) setattr(portal_type, self.class_property, list(original_property_list))
class PortalTypeHiddenContentTypeTemplateItem(PortalTypeAllowedContentTypeTemplateItem): class PortalTypeHiddenContentTypeTemplateItem(PortalTypeAllowedContentTypeTemplateItem):
...@@ -2380,7 +2381,7 @@ class CatalogResultKeyTemplateItem(BaseTemplateItem): ...@@ -2380,7 +2381,7 @@ class CatalogResultKeyTemplateItem(BaseTemplateItem):
LOG('BusinessTemplate', 0, 'no SQL catalog was available') LOG('BusinessTemplate', 0, 'no SQL catalog was available')
return return
sql_search_result_keys = list(catalog.sql_search_result_keys) sql_search_result_keys = list(catalog.sql_search_result_keys)
object_path = kw.get('object_path', None) object_path = kw.get('object_path', None)
if object_path is not None: if object_path is not None:
object_keys = [object_path] object_keys = [object_path]
else: else:
...@@ -3424,7 +3425,7 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -3424,7 +3425,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
'_path_item', '_path_item',
'_action_item', '_action_item',
'_portal_type_roles_item', '_portal_type_roles_item',
'_local_roles_item', '_local_roles_item',
'_catalog_result_key_item', '_catalog_result_key_item',
'_catalog_related_key_item', '_catalog_related_key_item',
'_catalog_result_table_item', '_catalog_result_table_item',
...@@ -3686,7 +3687,7 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -3686,7 +3687,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
# Update local dictionary containing all setup parameters # Update local dictionary containing all setup parameters
# This may include mappings # This may include mappings
self.portal_templates.updateLocalConfiguration(self, **kw) self.portal_templates.updateLocalConfiguration(self, **kw)
local_configuration = self.portal_templates.getLocalConfiguration(self) local_configuration = self.portal_templates.getLocalConfiguration(self)
# update catalog if necessary # update catalog if necessary
update_catalog=0 update_catalog=0
......
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