[CMF-checkins] CVS: CMF/CMFCore - PortalContent.py: TypesTool.py:

Andrew Sawyers andrew@zope.com
Wed, 9 Jan 2002 14:43:34 -0500

Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv18638/CMFCore

Modified Files:
      Tag: CMF-1_2-branch
	PortalContent.py TypesTool.py 
Log Message:

*Workflow notification has moved to the contstructInstance method 
on the TypesTool after the _setPortalTypeName method has been called
on the object rather then in manage_afterAdd.

=== CMF/CMFCore/PortalContent.py => ===
         if aq_base(container) is not aq_base(self):
-            wf = getToolByName(self, 'portal_workflow', None)
-            if wf is not None:
-                wf.notifyCreated(self)
     def manage_beforeDelete(self, item, container):

=== CMF/CMFCore/TypesTool.py => ===
 from Globals import InitializeClass, DTMLFile
 from utils import UniqueObject, SimpleItemWithProperties, tuplize
-from utils import _dtmldir, _checkPermission, cookString
+from utils import _dtmldir, _checkPermission, cookString, getToolByName
 import string
 import urllib
 from AccessControl import getSecurityManager, ClassSecurityInfo
@@ -448,7 +448,9 @@
         if hasattr(ob, '_setPortalTypeName'):
+        wf = getToolByName(ob, 'portal_workflow', None)
+        if wf is not None:
+            wf.notifyCreated(ob)
         return ob
 InitializeClass( FactoryTypeInformation )