changeset 5688:80c5a662e132

Preventing RenamePage action from throwing exception due to abscence of configuration option show_rename_redirect.
author Eugene Syromyatnikov <evgsyr@gmail.com>
date Fri, 04 Jun 2010 19:32:10 +0400
parents bf0b4b96dcb4
children 282ff1a50c4d
files MoinMoin/action/RenamePage.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/RenamePage.py	Fri Jun 04 18:55:17 2010 +0400
+++ b/MoinMoin/action/RenamePage.py	Fri Jun 04 19:32:10 2010 +0400
@@ -29,7 +29,10 @@
         filterfn = re.compile(ur"^%s/.*$" % re.escape(pagename), re.U).match
         subpagenames = request.rootpage.getPageList(user='', exists=1, filter=filterfn)
         self.subpages = [pagename for pagename in subpagenames if self.request.user.may.delete(pagename)]
-        self.show_redirect = request.cfg.show_rename_redirect
+        try:
+            self.show_redirect = request.cfg.show_rename_redirect
+        except AttributeError:
+            self.show_redirect = False
         try:
             self.rename_redirect = int(self.request.form.get('rename_redirect', '0'))
         except ValueError: