]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
In cmd_create(), use a redirect directive instead of viewing the page;
authorGuido van Rossum <guido@python.org>
Thu, 17 Oct 2002 21:41:42 +0000 (21:41 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 17 Oct 2002 21:41:42 +0000 (21:41 +0000)
this avoids resubmitting POST data.

Remove redundant 'Page' from label passed from cmd_new().

Demo/cgi/wiki.py

index a3a4938550dd42d11cdae349d6e76c55cd547b08..c04b57ef4966bf134225d0fd3d2bae9c0e57dd9d 100644 (file)
@@ -67,10 +67,17 @@ class WikiPage:
             print "<p>An error occurred while attempting to write the file:"
             print "<p>", escape(error)
         else:
-            self.cmd_view(form)
+            # Use a redirect directive, to avoid "reload page" problems
+            print "<head>"
+            s = '<meta http-equiv="refresh" content="1; URL=%s">'
+            print s % (self.scripturl + "?cmd=view&page=" + self.name)
+            print "<head>"
+            print "<h1>OK</h1>"
+            print "<p>If nothing happens, please click here:",
+            print self.mklink("view", self.name, self.name)
 
     def cmd_new(self, form):
-        self.cmd_edit(form, label="Create Page")
+        self.cmd_edit(form, label="Create")
 
     def iswikiword(self, word):
         return re.match("[A-Z][a-z]+([A-Z][a-z]*)+", word)