From 7b6524357f6082d7f06e2b7b2b9bfec2be80959b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 16 May 2020 20:46:21 +0200 Subject: [PATCH] stages/user_logout: fix dependency on PENDING_USER --- passbook/stages/user_logout/stage.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/passbook/stages/user_logout/stage.py b/passbook/stages/user_logout/stage.py index ef360b3ed..6b64f4563 100644 --- a/passbook/stages/user_logout/stage.py +++ b/passbook/stages/user_logout/stage.py @@ -3,7 +3,6 @@ from django.contrib.auth import logout from django.http import HttpRequest, HttpResponse from structlog import get_logger -from passbook.flows.planner import PLAN_CONTEXT_PENDING_USER from passbook.flows.stage import AuthenticationStage LOGGER = get_logger() @@ -13,10 +12,10 @@ class UserLogoutStageView(AuthenticationStage): """Finalise Authentication flow by logging the user in""" def get(self, request: HttpRequest) -> HttpResponse: - logout(self.request) LOGGER.debug( "Logged out", - user=self.executor.plan.context[PLAN_CONTEXT_PENDING_USER], + user=request.user, flow_slug=self.executor.flow.slug, ) + logout(self.request) return self.executor.stage_ok()