From e4f877bbeae724dd315242068140745a40c3481f Mon Sep 17 00:00:00 2001 From: Maxime Bombar Date: Wed, 31 Oct 2018 16:17:51 +0100 Subject: [PATCH] [Users] Archived and Disabled accounts can't reset their passords --- users/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/users/views.py b/users/views.py index e3060105..a94a7927 100644 --- a/users/views.py +++ b/users/views.py @@ -1034,7 +1034,8 @@ def reset_password(request): try: user = User.objects.get( pseudo=userform.cleaned_data['pseudo'], - email=userform.cleaned_data['email'] + email=userform.cleaned_data['email'], + state__in=[User.STATE_ACTIVE, User.STATE_NOT_YET_ACTIVE], ) except User.DoesNotExist: messages.error(request, _("The user doesn't exist."))