Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#600 closed enhancement (fixed)

decorator_from_middleware currently doesn't handle process_view

Reported by: hugo Owned by: adrian
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: UI/UX:


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 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

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