stages/user_login: only show successful login message at login stage

This commit is contained in:
Jens Langhammer 2020-10-20 12:11:59 +02:00
parent 395ef43eae
commit e2ca72adf0
2 changed files with 1 additions and 2 deletions

View File

@ -1,7 +1,6 @@
"""passbook password stage""" """passbook password stage"""
from typing import Any, Dict, List, Optional from typing import Any, Dict, List, Optional
from django.contrib import messages
from django.contrib.auth import _clean_credentials from django.contrib.auth import _clean_credentials
from django.contrib.auth.backends import BaseBackend from django.contrib.auth.backends import BaseBackend
from django.contrib.auth.signals import user_login_failed from django.contrib.auth.signals import user_login_failed
@ -122,5 +121,4 @@ class PasswordStageView(FormView, StageView):
self.executor.plan.context[ self.executor.plan.context[
PLAN_CONTEXT_AUTHENTICATION_BACKEND PLAN_CONTEXT_AUTHENTICATION_BACKEND
] = user.backend ] = user.backend
messages.success(self.request, _("Successfully logged in!"))
return self.executor.stage_ok() return self.executor.stage_ok()

View File

@ -39,4 +39,5 @@ class UserLoginStageView(StageView):
flow_slug=self.executor.flow.slug, flow_slug=self.executor.flow.slug,
session_duration=self.executor.current_stage.session_duration, session_duration=self.executor.current_stage.session_duration,
) )
messages.success(self.request, _("Successfully logged in!"))
return self.executor.stage_ok() return self.executor.stage_ok()