Style fixes and add ValueError exception catching to soc.views.helper.request module
authorPawel Solyga <Pawel.Solyga@gmail.com>
Wed, 04 Mar 2009 17:32:55 +0000
changeset 1631 25ec972b5aa2
parent 1630 850c08c90345
child 1632 73a9bc6a85d9
Style fixes and add ValueError exception catching to soc.views.helper.request module Patch by: Pawel Solyga Reviewed by: to-be-reviewed
app/soc/views/helper/requests.py
--- a/app/soc/views/helper/requests.py	Wed Mar 04 17:31:39 2009 +0000
+++ b/app/soc/views/helper/requests.py	Wed Mar 04 17:32:55 2009 +0000
@@ -51,7 +51,7 @@
   try:
     # GET parameter 'param_name' should be an integer value index
     value_idx = int(value_idx)
-  except:
+  except ValueError:
     # ignore bogus or missing parameter values, so return None (no message)
     return None
     
@@ -119,7 +119,7 @@
     # no HTTP referrer, so cannot possibly start with expected prefix
     return False
 
-  http_host = 'http://%s/%s' %(os.environ['HTTP_HOST'], url_name)
+  http_host = 'http://%s/%s' % (os.environ['HTTP_HOST'], url_name)
 
   if http_from.startswith(http_host):
     return True