We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb5b976 commit 43b613dCopy full SHA for 43b613d
authentication/views/common.py
@@ -47,11 +47,9 @@ def login_api_view(request):
47
# The authenticate method below will return None for inactive users
48
# We want to show inactive users an error message so they can activate
49
# their account, and also to re-send their activation email
50
- user = User.objects.filter(
51
- Q(username__iexact=login) | Q(email__iexact=login)
52
- ).first()
+ user = AuthLoginBackend.find_user(login)
53
54
- if user is not None and user.check_password(password) and not user.is_active:
+ if user and not user.is_active and user.check_password(password):
55
send_activation_email(user, None)
56
raise ValidationError({"user_state": "inactive"})
57
0 commit comments