Ticket #11378: patch

File patch, 1.3 KB (added by ssdd, 16 years ago)
  • base.py

     
    6868        from django.core import exceptions, urlresolvers
    6969        from django.conf import settings
    7070
    71         # Apply request middleware
    72         for middleware_method in self._request_middleware:
    73             response = middleware_method(request)
    74             if response:
    75                 return response
     71        try:
     72            # Apply request middleware
     73            for middleware_method in self._request_middleware:
     74                response = middleware_method(request)
     75                if response:
     76                    return response
    7677
    77         # Get urlconf from request object, if available.  Otherwise use default.
    78         urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
     78            # Get urlconf from request object, if available.  Otherwise use default.
     79            urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
    7980
    80         resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
    81         try:
     81            resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
     82
    8283            callback, callback_args, callback_kwargs = resolver.resolve(
    8384                    request.path_info)
    8485
Back to Top