[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - bundle.py:1.6

Guido van Rossum guido@python.org
Mon, 16 Jun 2003 22:04:47 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv32168

Modified Files:
	bundle.py 
Log Message:
Add a temporary safety check: disallow bundle updates to the default
folder.


=== Zope3/src/zope/app/browser/services/bundle.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/services/bundle.py:1.5	Mon Jun 16 21:53:47 2003
+++ Zope3/src/zope/app/browser/services/bundle.py	Mon Jun 16 22:04:47 2003
@@ -56,6 +56,15 @@
     # Methods called from the page template (bundle.pt)
 
     def update(self):
+        if not self.request.form:
+            return
+        if zapi.getName(self.context) == "default":
+            # XXX This is not right: we should be able to tell bundles
+            # from non-bundles and only allow this command for
+            # bundles.  The Bundle tab should only be present for
+            # bundles.  But for now, we simply prevent the user from
+            # making a big mistake and changing the default folder.
+            return "ERROR: Won't change the default folder"
         if "allclear" in self.request:
             count = 0
             for path, obj in self.configurations: