[Zope-Checkins] CVS: Packages/webdav - Resource.py:1.55.10.5.8.1

Sidnei da Silva sidnei at awkly.org
Wed Dec 1 15:09:56 EST 2004


Update of /cvs-repository/Packages/webdav
In directory cvs.zope.org:/tmp/cvs-serv20428/lib/python/webdav

Modified Files:
      Tag: dc-large_file-branch
	Resource.py 
Log Message:

      - webdav.Resource: during COPY, manage_afterClone was called way
        too early, thus the object wasn't bound to the database and
        couldn't find a context. Changed to behave the same way as
        CopySupport.



=== Packages/webdav/Resource.py 1.55.10.5 => 1.55.10.5.8.1 ===
--- Packages/webdav/Resource.py:1.55.10.5	Thu Sep 30 12:17:38 2004
+++ Packages/webdav/Resource.py	Wed Dec  1 15:09:56 2004
@@ -370,13 +370,9 @@
             else:
                 raise Locked, 'Destination is locked.'
 
-        ob=self._getCopy(parent)
-        ob.manage_afterClone(ob)
-        # We remove any locks from the copied object because webdav clients
-        # don't track the lock status and the lock token for copied resources
-        ob.wl_clearLocks()
-
+        ob = self._getCopy(parent)
         ob._setId(name)
+
         if depth=='0' and isDavCollection(ob):
             for id in ob.objectIds():
                 ob._delObject(id)
@@ -385,6 +381,11 @@
             self.dav__validate(object, 'DELETE', REQUEST)
             parent._delObject(name)
         parent._setObject(name, ob)
+        ob = parent._getOb(name)
+        ob.manage_afterClone(ob)
+        # We remove any locks from the copied object because webdav clients
+        # don't track the lock status and the lock token for copied resources
+        ob.wl_clearLocks()
         RESPONSE.setStatus(existing and 204 or 201)
         if not existing:
             RESPONSE.setHeader('Location', dest)



More information about the Zope-Checkins mailing list