Commits

ivirabyan committed a00b8d4

Fixed bug with Http404 error

  • Participants
  • Parent commits 0dfbe00

Comments (0)

Files changed (1)

dogslow/__init__.py

 from django.conf import settings
 from django.core.exceptions import MiddlewareNotUsed
 from django.core.mail.message import EmailMessage
-from django.core.urlresolvers import resolve
+from django.core.urlresolvers import resolve, Resolver404
 
 from dogslow.timer import Timer
 
         """Returns True if this request's URL resolves to a url pattern whose
         name is listed in settings.DOGSLOW_IGNORE_URLS.
         """
-        match = resolve(request.META.get('PATH_INFO'))
+        try:
+            match = resolve(request.META.get('PATH_INFO'))
+        except Resolver404:
+            return False
         return match and (match.url_name in
                        getattr(settings, 'DOGSLOW_IGNORE_URLS', ()))