From 251cfb9b49c3fa2c57d4526399f07339f3324e63 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 22 Dec 2020 23:07:33 +0100 Subject: [PATCH] Construct a middleware without a get_response function is deprecated and will not work in a future release. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yohann D'ANELLO Signed-off-by: Yohann D'ANELLO --- cas_server/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cas_server/views.py b/cas_server/views.py index a1f2873..bbf5490 100644 --- a/cas_server/views.py +++ b/cas_server/views.py @@ -288,7 +288,8 @@ class FederateAuth(CsrfExemptView): # else, a User is trying to log in using an identity provider except FederatedIendityProvider.DoesNotExist: # Manually checking for csrf to protect the code below - reason = CsrfViewMiddleware().process_view(request, None, (), {}) + reason = CsrfViewMiddleware(lambda request: HttpResponse()) \ + .process_view(request, None, (), {}) if reason is not None: # pragma: no cover (csrf checks are disabled during tests) return reason # Failed the test, stop here. form = forms.FederateSelect(request.POST)