stages/user_logout: fix dependency on PENDING_USER

This commit is contained in:
Jens Langhammer 2020-05-16 20:46:21 +02:00
parent 83013f063d
commit 7b6524357f

View file

@ -3,7 +3,6 @@ from django.contrib.auth import logout
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from structlog import get_logger from structlog import get_logger
from passbook.flows.planner import PLAN_CONTEXT_PENDING_USER
from passbook.flows.stage import AuthenticationStage from passbook.flows.stage import AuthenticationStage
LOGGER = get_logger() LOGGER = get_logger()
@ -13,10 +12,10 @@ class UserLogoutStageView(AuthenticationStage):
"""Finalise Authentication flow by logging the user in""" """Finalise Authentication flow by logging the user in"""
def get(self, request: HttpRequest) -> HttpResponse: def get(self, request: HttpRequest) -> HttpResponse:
logout(self.request)
LOGGER.debug( LOGGER.debug(
"Logged out", "Logged out",
user=self.executor.plan.context[PLAN_CONTEXT_PENDING_USER], user=request.user,
flow_slug=self.executor.flow.slug, flow_slug=self.executor.flow.slug,
) )
logout(self.request)
return self.executor.stage_ok() return self.executor.stage_ok()