From: Guido van Rossum Date: Thu, 17 Oct 2002 21:41:42 +0000 (+0000) Subject: In cmd_create(), use a redirect directive instead of viewing the page; X-Git-Tag: v2.3c1~3743 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c3848b39b9b87bd0f81b145b1402093e659673e;p=thirdparty%2FPython%2Fcpython.git 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(). --- diff --git a/Demo/cgi/wiki.py b/Demo/cgi/wiki.py index a3a4938550dd..c04b57ef4966 100644 --- a/Demo/cgi/wiki.py +++ b/Demo/cgi/wiki.py @@ -67,10 +67,17 @@ class WikiPage: print "

An error occurred while attempting to write the file:" print "

", escape(error) else: - self.cmd_view(form) + # Use a redirect directive, to avoid "reload page" problems + print "" + s = '' + print s % (self.scripturl + "?cmd=view&page=" + self.name) + print "" + print "

OK

" + print "

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)