restore password reset only for active users (#49131)

Bug introduced in commit from #48264
This commit is contained in:
Benjamin Dauvergne 2020-12-18 07:39:53 +01:00
parent 1f2ea15580
commit 9eb5264024
1 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,9 @@ class PasswordResetForm(forms.Form):
email = self.cleaned_data["email"].strip()
users = get_user_queryset()
active_users = users.filter(
Q(email__iexact=email) | Q(username__iexact=email), deleted__isnull=True)
Q(email__iexact=email) | Q(username__iexact=email),
deleted__isnull=True,
is_active=True)
for user in active_users:
# we don't set the password to a random string, as some users should not have
# a password