Ticket #12250: django-base-handlers-view-middleware.patch

File django-base-handlers-view-middleware.patch, 1.2 KB (added by Michael Manfre, 15 years ago)
  • django/core/handlers/base.py

     
    8989                callback, callback_args, callback_kwargs = resolver.resolve(
    9090                        request.path_info)
    9191
    92                 # Apply view middleware
    93                 for middleware_method in self._view_middleware:
    94                     response = middleware_method(request, callback, callback_args, callback_kwargs)
    95                     if response:
    96                         return response
     92                try:
     93                    # Apply view middleware
     94                    for middleware_method in self._view_middleware:
     95                        response = middleware_method(request, callback, callback_args, callback_kwargs)
     96                        if response:
     97                            return response
    9798
    98                 try:
    9999                    response = callback(request, *callback_args, **callback_kwargs)
    100100                except Exception, e:
    101101                    # If the view raised an exception, run it through exception
Back to Top