changeset 3679:78850075daad

info action: fix exception happening for invalid query args
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 08 Jun 2008 04:11:55 +0200
parents 0cbd8b41aebd
children 335b1d73c909
files MoinMoin/action/info.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/info.py	Sun Jun 08 01:29:49 2008 +0200
+++ b/MoinMoin/action/info.py	Sun Jun 08 04:11:55 2008 +0200
@@ -207,8 +207,14 @@
         request.write("[%s] " % page.link_to(request, text=text, querystr=querystr, rel='nofollow'))
     request.write(f.paragraph(0))
 
-    show_hitcounts = int(request.form.get('hitcounts', [0])[0]) != 0
-    show_general = int(request.form.get('general', [0])[0]) != 0
+    try:
+        show_hitcounts = int(request.form.get('hitcounts', [0])[0]) != 0
+    except ValueError:
+        show_hitcounts = False
+    try:
+        show_general = int(request.form.get('general', [0])[0]) != 0
+    except ValueError:
+        show_general = False
 
     if show_hitcounts:
         from MoinMoin.stats import hitcounts