mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
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:
parent
f5c4cdee58
commit
f34cb78867
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user