From e8153e7e0648f2e0440600fb81f91b3de498e8aa Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 21 Apr 2020 22:36:00 +0200 Subject: [PATCH 4/4] misc: re-use logout view in deletion view As user is not accessible anymore through ModelBackend.get_user(), we must call logout() directly, and not through a redirection. --- src/authentic2/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git src/authentic2/views.py src/authentic2/views.py index 0f3f905a..8819befa 100644 --- src/authentic2/views.py +++ src/authentic2/views.py @@ -1151,7 +1151,7 @@ class ValidateDeletionView(TemplateView): if self.user == request.user: # No validation message displayed, as the user will surely # notice their own account deletion... - return utils.redirect(request, 'auth_logout') + return logout(request, check_referer=False) # No real use for cancel_url or next_url here, assuming the link # has been received by email. We instead redirect the user to the # homepage. -- 2.26.0