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

Shane Hathaway shane at zope.com
Fri Mar 19 17:11:26 EST 2004


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

Modified Files:
	StagingTool.py 
Log Message:
Added tests of getObjectStages().

Also made getObjectStages() return an empty list when no stages exist.


=== CMF/CMFStaging/StagingTool.py 1.18 => 1.19 ===
--- CMF/CMFStaging/StagingTool.py:1.18	Fri Mar 19 16:40:00 2004
+++ CMF/CMFStaging/StagingTool.py	Fri Mar 19 17:10:56 2004
@@ -179,7 +179,6 @@
     def getStageOf(self, obj):
         """Returns the stage name the object is in the context of.
         """
-        verifyPermission(StageObjects, obj)
         portal = aq_parent(aq_inner(self))
         for stage_name, stage_title, path in self._stages:
             stage = self._getStage(portal, path)
@@ -421,8 +420,11 @@
         """Returns a structure suitable for presentation of staging status.
         """
         res = []
-        revisions = self._getObjectVersionIds(source, include_status=1)
         source_stage = self.getStageOf(source)
+        if not source_stage:
+            # Not in any stage.
+            return res
+        revisions = self._getObjectVersionIds(source, include_status=1)
         objs = self._getObjectStages(source)
         for stage_name, stage_title, path in self._stages:
             stageable = (stage_name != source_stage) and (




More information about the CMF-checkins mailing list