SVN: CMF/trunk/CMFUid/UniqueIdAnnotationTool.py - portal_uidhandler isn't always available

Yvo Schubbe <[email protected]> Thu, 21 Jun 2007 16:35:23 -0400 (EDT)
Newsgroups gmane.comp.web.zope.cmf.cvs
Message-ID <20070621203523.A05D8203302__38390.4847702526$1182458129$gmane$org@mail.zope.org>
Log message for revision 76921:
  - portal_uidhandler isn't always available

Changed:
  U   CMF/trunk/CMFUid/UniqueIdAnnotationTool.py

-=-
Modified: CMF/trunk/CMFUid/UniqueIdAnnotationTool.py
===================================================================
--- CMF/trunk/CMFUid/UniqueIdAnnotationTool.py	2007-06-21 20:06:05 UTC (rev 76920)
+++ CMF/trunk/CMFUid/UniqueIdAnnotationTool.py	2007-06-21 20:35:23 UTC (rev 76921)
@@ -76,7 +76,7 @@
     if IObjectAddedEvent.providedBy(event):
         if event.newParent is not None:
             anno_tool = queryUtility(IUniqueIdAnnotationManagement)
-            uid_handler = getToolByName(ob, 'portal_uidhandler')
+            uid_handler = getToolByName(ob, 'portal_uidhandler', None)
             if anno_tool is not None:
                 remove_on_add = anno_tool.getProperty('remove_on_add',False)
                 remove_on_clone = anno_tool.getProperty('remove_on_clone',False)
@@ -94,7 +94,7 @@
                  
     elif IObjectClonedEvent.providedBy(event):
         anno_tool = queryUtility(IUniqueIdAnnotationManagement)
-        uid_handler = getToolByName(ob, 'portal_uidhandler')
+        uid_handler = getToolByName(ob, 'portal_uidhandler', None)
 
         if anno_tool is not None:
             remove_on_clone = anno_tool.getProperty('remove_on_clone', False)