[CMF-checkins] CVS: CMF/CMFStaging - StagingTool.py:1.7

Shane Hathaway shane@cvs.zope.org
Mon, 17 Jun 2002 16:24:05 -0400


Update of /cvs-repository/CMF/CMFStaging
In directory cvs.zope.org:/tmp/cvs-serv22531

Modified Files:
	StagingTool.py 
Log Message:
When removing objects from stages, skip over stages where the object is
already gone.


=== CMF/CMFStaging/StagingTool.py 1.6 => 1.7 ===
     def removeStages(self, object, stages):
         """Removes the copies on the given stages."""
+        object_map = self._getObjectStages(object)
         container_map = self._getObjectStages(object, get_container=1)
         id = object.getId()
         for stage_name, container in container_map.items():
-            if container is not None and stage_name in stages:
-                container._delObject(id)
+            if object_map.get(stage_name) is not None:
+                if container is not None and stage_name in stages:
+                    container._delObject(id)
 
 
     security.declareProtected(StageObjects, 'versions')