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
This commit is contained in:
Adrian Holovaty 2005-10-10 13:51:58 +00:00
parent 22bbdc633c
commit f258a8fce2
1 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,10 @@ def decorator_from_middleware(middleware_class):
result = middleware.process_request(request) result = middleware.process_request(request)
if result is not None: if result is not None:
return result 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) response = view_func(request, *args, **kwargs)
if hasattr(middleware, 'process_response'): if hasattr(middleware, 'process_response'):
result = middleware.process_response(request, response) result = middleware.process_response(request, response)