From e2ca72adf01755c786ed4e5f86c2346d4d25dd12 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 20 Oct 2020 12:11:59 +0200 Subject: [PATCH] stages/user_login: only show successful login message at login stage --- passbook/stages/password/stage.py | 2 -- passbook/stages/user_login/stage.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/passbook/stages/password/stage.py b/passbook/stages/password/stage.py index 9dce680bf..914f537c9 100644 --- a/passbook/stages/password/stage.py +++ b/passbook/stages/password/stage.py @@ -1,7 +1,6 @@ """passbook password stage""" from typing import Any, Dict, List, Optional -from django.contrib import messages from django.contrib.auth import _clean_credentials from django.contrib.auth.backends import BaseBackend from django.contrib.auth.signals import user_login_failed @@ -122,5 +121,4 @@ class PasswordStageView(FormView, StageView): self.executor.plan.context[ PLAN_CONTEXT_AUTHENTICATION_BACKEND ] = user.backend - messages.success(self.request, _("Successfully logged in!")) return self.executor.stage_ok() diff --git a/passbook/stages/user_login/stage.py b/passbook/stages/user_login/stage.py index 4ec5323a3..907d6ce32 100644 --- a/passbook/stages/user_login/stage.py +++ b/passbook/stages/user_login/stage.py @@ -39,4 +39,5 @@ class UserLoginStageView(StageView): flow_slug=self.executor.flow.slug, session_duration=self.executor.current_stage.session_duration, ) + messages.success(self.request, _("Successfully logged in!")) return self.executor.stage_ok()