slight cleanup

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer
2025-03-06 17:04:16 +00:00
parent 7f5cfdc3d3
commit 4aa497346d
3 changed files with 6 additions and 9 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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
)