google-code-export / django-simple-captcha

Automatically exported from code.google.com/p/django-simple-captcha
MIT License
0 stars 0 forks source link

very very bad exception catch in captcha/fields.py #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
"except Exception":  in this place catches every exception which was raised  
previously in every place/app. 

===================================================================
--- captcha/fields.py   (wersja 58)
+++ captcha/fields.py   (kopia robocza)
@@ -4,7 +4,7 @@
 from django.core.exceptions import ImproperlyConfigured
 from django.utils.safestring import mark_safe
 from django.utils.translation import ugettext_lazy as _
-from django.core.urlresolvers import reverse
+from django.core.urlresolvers import reverse,  NoReverseMatch
 from captcha.models import CaptchaStore
 from captcha.conf import settings
 from captcha.helpers import *
@@ -41,7 +41,7 @@

         try:
             image_url = reverse('captcha-image', args=('dummy',))
-        except Exception,e:
+        except NoReverseMatch, e:
             raise ImproperlyConfigured('Make sure you\'ve included captcha.urls as explained in the INSTALLATION section on http://code.google.com/p/django-simple-captcha/')

Original issue reported on code.google.com by tdrobisz...@gmail.com on 28 Jan 2011 at 2:57

GoogleCodeExporter commented 9 years ago
Good catch. Fixed in r59.

Original comment by mbonetti on 9 Feb 2011 at 2:42