From 4aa497346d9ebc5dfee56f4d7ba06d1331ad9768 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 6 Mar 2025 17:04:16 +0000 Subject: [PATCH] slight cleanup Signed-off-by: Jens Langhammer --- authentik/stages/email/stage.py | 5 ++--- authentik/stages/user_delete/stage.py | 5 ++--- authentik/stages/user_login/stage.py | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/authentik/stages/email/stage.py b/authentik/stages/email/stage.py index 02c05ce729..47b5b5b229 100644 --- a/authentik/stages/email/stage.py +++ b/authentik/stages/email/stage.py @@ -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: diff --git a/authentik/stages/user_delete/stage.py b/authentik/stages/user_delete/stage.py index 2bcd722c15..0b9e76131a 100644 --- a/authentik/stages/user_delete/stage.py +++ b/authentik/stages/user_delete/stage.py @@ -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) diff --git a/authentik/stages/user_login/stage.py b/authentik/stages/user_login/stage.py index e420d2748b..abc7b9880b 100644 --- a/authentik/stages/user_login/stage.py +++ b/authentik/stages/user_login/stage.py @@ -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 )