mirror of https://github.com/django/django.git
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:
parent
22bbdc633c
commit
f258a8fce2
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue