[CMF-checkins] CVS: CMF/CMFWorkspaces/skins/workspaces - content_add.py:1.4

Matthew T. Kromer matt@zope.com
Fri, 14 Feb 2003 11:43:20 -0500


Update of /cvs-repository/CMF/CMFWorkspaces/skins/workspaces
In directory cvs.zope.org:/tmp/cvs-serv15395

Modified Files:
	content_add.py 
Log Message:
Add a lock_object flag to content_add, the default is true (old behavior)
If set to false (0) content will not be locked when it is created.


=== CMF/CMFWorkspaces/skins/workspaces/content_add.py 1.3 => 1.4 ===
--- CMF/CMFWorkspaces/skins/workspaces/content_add.py:1.3	Tue Jan  7 16:35:29 2003
+++ CMF/CMFWorkspaces/skins/workspaces/content_add.py	Fri Feb 14 11:43:20 2003
@@ -1,4 +1,4 @@
-##parameters=type, id=None, title='', return_object=0
+##parameters=type, id=None, title='', return_object=0, lock_object=1
 ##title=Adds an object to a BTreeFolder and makes a link in the workspace
 # Also generates the ID if necessary, assuming that dest is a BTreeFolder2.
 
@@ -21,7 +21,7 @@
 if workspace:
     ws = context.restrictedTraverse(workspace)
     ws.addReference(ob)
-context.portal_lock.lock(ob) # Lock it on creation
+if lock_object: context.portal_lock.lock(ob) # Lock it on creation
 
 # Note that invokeFactory() causes a redirection.
 if return_object: