@ -145,9 +145,8 @@ class EmailStageView(ChallengeStageView):
|
||||
user.save()
|
||||
return self.executor.stage_ok()
|
||||
if PLAN_CONTEXT_PENDING_USER not in self.executor.plan.context:
|
||||
message = _("No pending user")
|
||||
self.logger.debug(message)
|
||||
return self.executor.stage_invalid(message)
|
||||
self.logger.warning("No pending user")
|
||||
return self.executor.stage_invalid(_("No pending user"))
|
||||
# Check if we've already sent the initial e-mail
|
||||
if PLAN_CONTEXT_EMAIL_SENT not in self.executor.plan.context:
|
||||
try:
|
||||
|
||||
@ -15,9 +15,8 @@ class UserDeleteStageView(StageView):
|
||||
"""Delete currently pending user"""
|
||||
user = self.get_pending_user()
|
||||
if not user.is_authenticated:
|
||||
message = _("No Pending User.")
|
||||
self.logger.debug(message)
|
||||
return self.executor.stage_invalid(message)
|
||||
self.logger.warning("No authenticated user")
|
||||
return self.executor.stage_invalid(_("No authenticated User."))
|
||||
logout(self.request)
|
||||
user.delete()
|
||||
self.logger.debug("Deleted user", user=user)
|
||||
|
||||
@ -80,9 +80,8 @@ class UserLoginStageView(ChallengeStageView):
|
||||
def do_login(self, request: HttpRequest, remember: bool = False) -> HttpResponse:
|
||||
"""Attach the currently pending user to the current session"""
|
||||
if PLAN_CONTEXT_PENDING_USER not in self.executor.plan.context:
|
||||
message = _("No Pending user to login.")
|
||||
self.logger.debug(message)
|
||||
return self.executor.stage_invalid(message)
|
||||
self.logger.warning("No pending user to login")
|
||||
return self.executor.stage_invalid(_("No Pending user to login."))
|
||||
backend = self.executor.plan.context.get(
|
||||
PLAN_CONTEXT_AUTHENTICATION_BACKEND, BACKEND_INBUILT
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user