middleware: Fix anonymous access to setup view

Django runs process_request() on all the middleware classes in order.
Then it runs process_view() on all of them again.  During the runs, if
any of the views return a HttpResponse.  Further processing is ignored.

Setup middleware was handling process_request() and returning
HttpResponse if the application as not setup.  However, stronghold
middleware handles process_view().  Since process_request happens first
and response is being returned there, stronghold middleware is never
called.

Make setup middleware use process_view() instead.
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2016-06-02 20:13:35 -04:00
1 parent f5c4cdee58
commit f34cb78867
1 file changed
+1 -1
+1 -1
View File
@@ -36,7 +36,7 @@ class SetupMiddleware(object):
"""Show setup page or progress if setup is neccessary or running."""
@staticmethod
def process_request(request):
def process_view(request, view_func, view_args, view_kwargs):
"""Handle a request as Django middleware request handler."""
# Perform a URL resolution. This is slightly inefficient as
# Django will do this resolution again.