[Zope-CVS] CVS: Products/DBTab - UndoPatch.py:1.2

Shane Hathaway shane@zope.com
Thu, 17 Oct 2002 13:12:43 -0400


Update of /cvs-repository/Products/DBTab
In directory cvs.zope.org:/tmp/cvs-serv30705

Modified Files:
	UndoPatch.py 
Log Message:
Undo at the application root was broken.  Fixed.


=== Products/DBTab/UndoPatch.py 1.1 => 1.2 ===
--- Products/DBTab/UndoPatch.py:1.1	Wed Oct 16 17:13:04 2002
+++ Products/DBTab/UndoPatch.py	Thu Oct 17 13:12:42 2002
@@ -58,18 +58,18 @@
 
         ##############################
         # Here is the patched part.
-        if getattr(aq_parent(aq_inner(self)), '_p_jar') == self._p_jar:
+        if getattr(aq_parent(aq_inner(self)), '_p_jar', None) == self._p_jar:
             # We only want to undo things done here
             opath='/'.join(self.getPhysicalPath())
         else:
-            # Special case: at the mounted root of a database,
-            # allow global undo.
+            # Special case: at the root of a database,
+            # allow undo of any path.
             opath = None
         if opath: spec['description']=Prefix(opath)
-        ##############################
 
         r = self._p_jar.db().undoInfo(
             first_transaction, last_transaction, spec)
+        ##############################
 
         encode = base64.encodestring
         for d in r: