Style fixes and add ValueError exception catching to soc.views.helper.request module
Patch by: Pawel Solyga
Reviewed by: to-be-reviewed
--- 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