[Zope3-checkins] CVS: Zope3/src/zope/app - copypastemove.py:1.10.24.7

Jim Fulton jim at zope.com
Mon Sep 15 16:48:48 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app
In directory cvs.zope.org:/tmp/cvs-serv10942/src/zope/app

Modified Files:
      Tag: parentgeddon-branch
	copypastemove.py 
Log Message:
Woo hoo. The tests all pass. Zope even runs. :)


=== Zope3/src/zope/app/copypastemove.py 1.10.24.6 => 1.10.24.7 ===
--- Zope3/src/zope/app/copypastemove.py:1.10.24.6	Mon Sep 15 14:12:25 2003
+++ Zope3/src/zope/app/copypastemove.py	Mon Sep 15 16:48:18 2003
@@ -29,6 +29,7 @@
 from zope.app.location import locationCopy
 from zope.app.event import publish
 from zope.app.event.objectevent import ObjectCopiedEvent
+from zope.proxy import removeAllProxies
 
 class ObjectMover:
     '''Use getAdapter(obj, IObjectMover) to move an object somewhere.'''
@@ -65,6 +66,9 @@
         chooser = zapi.getAdapter(target, INameChooser)
         new_name = chooser.chooseName(new_name, obj)
 
+        # Can't store security proxies
+        obj = removeAllProxies(obj)
+
         target[new_name] = obj
         del container[orig_name]
 
@@ -78,7 +82,7 @@
         Returns True if it can be moved there. Otherwise, returns
         false.
         '''
-        return self.context.__parent__.__class__ is target.__class__ 
+        return self.context.__parent__.__class__ == target.__class__ 
 
 class ObjectCopier:
 




More information about the Zope3-Checkins mailing list