From f258a8fce28ca65f2cfb3798b36f262c65639190 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 10 Oct 2005 13:51:58 +0000 Subject: [PATCH] Fixed #600 -- decorator_from_middleware now handles process_view. Thanks, Hugo git-svn-id: http://code.djangoproject.com/svn/django/trunk@820 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/decorators.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/django/utils/decorators.py b/django/utils/decorators.py index b21a4e4248..1333f9da88 100644 --- a/django/utils/decorators.py +++ b/django/utils/decorators.py @@ -12,6 +12,10 @@ def decorator_from_middleware(middleware_class): result = middleware.process_request(request) if result is not None: return result + if hasattr(middleware, 'process_view'): + result = middleware.process_view(request, view_func, **kwargs) + if result is not None: + return result response = view_func(request, *args, **kwargs) if hasattr(middleware, 'process_response'): result = middleware.process_response(request, response)