diff --git a/apiserver/apiserver/api/serializers.py b/apiserver/apiserver/api/serializers.py index 5282da7..d36bb3b 100644 --- a/apiserver/apiserver/api/serializers.py +++ b/apiserver/apiserver/api/serializers.py @@ -792,4 +792,9 @@ class MyLoginSerializer(LoginSerializer): if not User.objects.filter(username=username).exists(): raise ValidationError(dict(username='Username not found. Try "first.last" or "first.middle.last".')) - return super().authenticate(**kwargs) + user = super().authenticate(**kwargs) + + if not user: + raise ValidationError(dict(password='Incorrect password. Check caps lock.')) + + return user