summaryrefslogtreecommitdiffstats
path: root/Demo/cgi/wiki.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-10-17 21:41:42 (GMT)
committerGuido van Rossum <guido@python.org>2002-10-17 21:41:42 (GMT)
commit9c3848b39b9b87bd0f81b145b1402093e659673e (patch)
treebcf370a2dc594a0605b421ff1cc796bc609b2e96 /Demo/cgi/wiki.py
parent8ed0204bc9249d314442158348b3949f1be50100 (diff)
downloadcpython-9c3848b39b9b87bd0f81b145b1402093e659673e.zip
cpython-9c3848b39b9b87bd0f81b145b1402093e659673e.tar.gz
cpython-9c3848b39b9b87bd0f81b145b1402093e659673e.tar.bz2
In cmd_create(), use a redirect directive instead of viewing the page;
this avoids resubmitting POST data. Remove redundant 'Page' from label passed from cmd_new().
Diffstat (limited to 'Demo/cgi/wiki.py')
-rw-r--r--Demo/cgi/wiki.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Demo/cgi/wiki.py b/Demo/cgi/wiki.py
index a3a4938..c04b57e 100644
--- a/Demo/cgi/wiki.py
+++ b/Demo/cgi/wiki.py
@@ -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)