[CMF-checkins] CVS: Products/CMFCore - PortalFolder.py:1.45.4.5

Stefan H. Holek stefan at epy.co.at
Tue Jul 20 08:44:02 EDT 2004


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv9765/CMFCore

Modified Files:
      Tag: CMF-1_4-branch
	PortalFolder.py 
Log Message:
CMFCore.PortalFolder: checkIdAvailable failed to catch zExceptions.BadRequest.


=== Products/CMFCore/PortalFolder.py 1.45.4.4 => 1.45.4.5 ===
--- Products/CMFCore/PortalFolder.py:1.45.4.4	Fri Apr 23 17:11:33 2004
+++ Products/CMFCore/PortalFolder.py	Tue Jul 20 08:43:32 2004
@@ -31,6 +31,7 @@
 from Acquisition import aq_parent, aq_inner, aq_base
 from DynamicType import DynamicType
 from utils import getToolByName, _checkPermission
+from zExceptions import BadRequest
 
 factory_type_information = (
   { 'id'             : 'Folder'
@@ -367,8 +368,12 @@
     def checkIdAvailable(self, id):
         try:
             self._checkId(id)
+        except BadRequest:
+            return 0
         except:
-            if sys.exc_info()[0] == 'Bad Request':
+            # Zope < 2.7
+            e, v, tb = sys.exc_info(); del tb
+            if str(e) == 'Bad Request':
                 return 0
             raise  # Some other exception.
         else:



More information about the CMF-checkins mailing list