Commit fbfc71a0 authored by Sebastien Robin's avatar Sebastien Robin

remove try/except when objects are removed from catalog

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10983 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 412c7a38
......@@ -1205,21 +1205,24 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
XXX Add filter of methods
"""
#LOG('Uncatalog object:',0,str(path))
if withCMF:
zope_root = getToolByName(self, 'portal_url').getPortalObject().aq_parent
site_root = getToolByName(self, 'portal_url').getPortalObject()
else:
zope_root = self.getPhysicalRoot()
site_root = self.aq_parent
uid = self.getUidForPath(path)
methods = self.sql_uncatalog_object
root_indexable = int(getattr(zope_root, 'isIndexable', 1))
site_indexable = int(getattr(site_root, 'isIndexable', 1))
if not (root_indexable and site_indexable) or uid is None:
return None
for method_name in methods:
# Do not put try/except here, it is required to raise error
# if uncatalog does not work.
method = getattr(self, method_name)
try:
method(uid = uid)
except ConflictError:
raise
except:
# This is a real LOG message
# which is required in order to be able to import .zexp files
LOG('SQLCatalog', WARNING,
'could not uncatalog object %s uid %s with method %s' % (path, uid, method_name))
def catalogTranslationList(self, object_list):
"""Catalog translations.
......@@ -1251,7 +1254,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
def getUidForPath(self, path):
""" Looks up into catalog table to convert path into uid """
try:
#try:
if path is None:
return None
# Get the appropriate SQL Method
......@@ -1262,13 +1265,6 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
return long(search_result[0].uid)
else:
return None
except ConflictError:
raise
except:
# This is a real LOG message
# which is required in order to be able to import .zexp files
LOG('SQLCatalog', WARNING, "could not find uid from path %s" % (path,))
return None
def hasPath(self, path):
""" Checks if path is catalogued """
......
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