From f34cb7886711d520f69a56e7e706a76410080735 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 1 Jun 2016 15:20:21 +0530 Subject: [PATCH] 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. --- plinth/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plinth/middleware.py b/plinth/middleware.py index b4ad0f0b4..692bbb4bd 100644 --- a/plinth/middleware.py +++ b/plinth/middleware.py @@ -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.