changeset 614:95fb435b72aa

refactor: use show action when no action is given
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 05 May 2006 09:39:41 +0200
parents 1ba2c3686e98
children fb4240ec8361
files MoinMoin/request.py
diffstat 1 files changed, 12 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request.py	Fri May 05 09:06:35 2006 +0200
+++ b/MoinMoin/request.py	Fri May 05 09:39:41 2006 +0200
@@ -1077,8 +1077,18 @@
                 execute(pagename, self)
                 raise MoinMoinNoFooter           
 
-            # 4. Or handle action
-            elif action:
+            # 4. Or redirect to another page
+            elif self.form.has_key('goto'):
+                self.http_redirect(Page(self, self.form['goto'][0]).url(self))
+                return self.finish()
+
+            # 5. Or handle action
+            else:
+                if action is None:
+                    action = 'show'
+                if not pagename and self.query_string:
+                    pagename = self.getPageNameFromQueryString()
+                # pagename could be empty after normalization e.g. '///' -> ''
                 # Use localized FrontPage if pagename is empty
                 if not pagename:
                     self.page = wikiutil.getFrontPage(self)
@@ -1105,23 +1115,6 @@
                     handler = getHandler(self, action)
                     handler(self.page.page_name, self)
 
-            # 5. Or redirect to another page
-            elif self.form.has_key('goto'):
-                self.http_redirect(Page(self, self.form['goto'][0]).url(self))
-                return self.finish()
-
-            # 6. Or (at last) visit pagename
-            else:
-                if not pagename and self.query_string:
-                    pagename = self.getPageNameFromQueryString()                    
-                # pagename could be empty after normalization e.g. '///' -> ''
-                if not pagename:
-                    pagename = wikiutil.getFrontPage(self).page_name
-
-                # Visit pagename
-                self.page = Page(self, pagename)
-                self.page.send_page(self, count_hit=1)
-
             # generate page footer (actions that do not want this footer use
             # raise util.MoinMoinNoFooter to break out of the default execution
             # path, see the "except MoinMoinNoFooter" below)