Commit aa5f3ccd authored by Sebastien Robin's avatar Sebastien Robin

make sure the import of catalog works


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1011 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aa5fbd11
...@@ -136,25 +136,25 @@ class CatalogMethodTemplateItem(ObjectTemplateItem): ...@@ -136,25 +136,25 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
portal_catalog = portal.portal_catalog portal_catalog = portal.portal_catalog
method_id = self.id method_id = self.id
if self._is_catalog_method and method_id not in portal_catalog.sql_catalog_object: if self._is_catalog_method and method_id not in portal_catalog.sql_catalog_object:
new_list = list(portal_catalog.sql_catalog_object + (method_id,)) new_list = list(tuple(portal_catalog.sql_catalog_object) + (method_id,))
new_list.sort() new_list.sort()
portal_catalog.sql_catalog_object = tuple(new_list) portal_catalog.sql_catalog_object = tuple(new_list)
if not(self._is_catalog_method) and method_id in portal_catalog.sql_catalog_object: if not(self._is_catalog_method) and method_id in portal_catalog.sql_catalog_object:
portal_catalog.sql_catalog_object = tuple(filter(lambda id: id != method_id, portal_catalog.sql_catalog_object)) portal_catalog.sql_catalog_object = tuple(filter(lambda id: id != method_id, portal_catalog.sql_catalog_object))
if self._is_uncatalog_method and method_id not in portal_catalog.sql_uncatalog_object: if self._is_uncatalog_method and method_id not in portal_catalog.sql_uncatalog_object:
new_list = list(portal_catalog.sql_uncatalog_object + (method_id,)) new_list = list(tuple(portal_catalog.sql_uncatalog_object) + (method_id,))
new_list.sort() new_list.sort()
portal_catalog.sql_uncatalog_object = tuple(new_list) portal_catalog.sql_uncatalog_object = tuple(new_list)
if not(self._is_uncatalog_method) and method_id in portal_catalog.sql_uncatalog_object: if not(self._is_uncatalog_method) and method_id in portal_catalog.sql_uncatalog_object:
portal_catalog.sql_uncatalog_object = tuple(filter(lambda id: id != method_id, portal_catalog.sql_uncatalog_object)) portal_catalog.sql_uncatalog_object = tuple(filter(lambda id: id != method_id, portal_catalog.sql_uncatalog_object))
if self._is_update_method and method_id not in portal_catalog.sql_update_object: if self._is_update_method and method_id not in portal_catalog.sql_update_object:
new_list = list(portal_catalog.sql_update_object + (method_id,)) new_list = list(tuple(portal_catalog.sql_update_object) + (method_id,))
new_list.sort() new_list.sort()
portal_catalog.sql_update_object = tuple(new_list) portal_catalog.sql_update_object = tuple(new_list)
if not(self._is_update_method) and method_id in portal_catalog.sql_update_object: if not(self._is_update_method) and method_id in portal_catalog.sql_update_object:
portal_catalog.sql_update_object = tuple(filter(lambda id: id != method_id, portal_catalog.sql_update_object)) portal_catalog.sql_update_object = tuple(filter(lambda id: id != method_id, portal_catalog.sql_update_object))
if self._is_clear_method and method_id not in portal_catalog.sql_clear_catalog: if self._is_clear_method and method_id not in portal_catalog.sql_clear_catalog:
new_list = list(portal_catalog.sql_clear_catalog + (method_id,)) new_list = list(tuple(portal_catalog.sql_clear_catalog) + (method_id,))
new_list.sort() new_list.sort()
portal_catalog.sql_clear_catalog = tuple(new_list) portal_catalog.sql_clear_catalog = tuple(new_list)
if not(self._is_clear_method) and method_id in portal_catalog.sql_clear_catalog: if not(self._is_clear_method) and method_id in portal_catalog.sql_clear_catalog:
......
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