[Zope3-checkins] SVN: Zope3/trunk/src/zwiki/wikipage.py Bugfix, avoid recursion

Roger Ineichen roger at projekt01.ch
Wed Apr 6 11:06:44 EDT 2005


Log message for revision 29888:
  Bugfix, avoid recursion
  Only allow to set the parent if not the wikipage is itself is the parent

Changed:
  U   Zope3/trunk/src/zwiki/wikipage.py

-=-
Modified: Zope3/trunk/src/zwiki/wikipage.py
===================================================================
--- Zope3/trunk/src/zwiki/wikipage.py	2005-04-06 14:19:23 UTC (rev 29887)
+++ Zope3/trunk/src/zwiki/wikipage.py	2005-04-06 15:06:44 UTC (rev 29888)
@@ -87,7 +87,12 @@
         self.setParents(parents)
 
     def setParents(self, parents):
-        self._annotations[HierarchyKey] = tuple(parents)
+        res = []
+        for p in parents:
+            if p != zapi.name(self.context):
+                #don't store myself as a parent
+                res.append(p)
+        self._annotations[HierarchyKey] = tuple(res)
 
     def getParents(self):
         return self._annotations[HierarchyKey]



More information about the Zope3-Checkins mailing list