Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#600 closed enhancement (fixed)

decorator_from_middleware currently doesn't handle process_view

Reported by: hugo Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When writing decorator_from_middleware, I only looked at the cache middleware and those only use process_request and process_response. This patch should add process_view support:

Index: django/utils/
--- django/utils/  (revision 817)
+++ django/utils/  (working copy)
@@ -12,6 +12,10 @@
                 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)

Change History (1)

comment:1 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [820]) Fixed #600 -- decorator_from_middleware now handles process_view. Thanks, Hugo

Note: See TracTickets for help on using tickets.
Back to Top