mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 05:20:12 +03:00
Merge 24b49f8cc5
into fd473aa905
This commit is contained in:
commit
a425923e6f
|
@ -18,10 +18,10 @@ class AuthTokenSerializer(serializers.Serializer):
|
||||||
if user:
|
if user:
|
||||||
if not user.is_active:
|
if not user.is_active:
|
||||||
msg = _('User account is disabled.')
|
msg = _('User account is disabled.')
|
||||||
raise exceptions.ValidationError(msg)
|
raise exceptions.AuthenticationFailed(msg)
|
||||||
else:
|
else:
|
||||||
msg = _('Unable to log in with provided credentials.')
|
msg = _('Unable to log in with provided credentials.')
|
||||||
raise exceptions.ValidationError(msg)
|
raise exceptions.AuthenticationFailed(msg)
|
||||||
else:
|
else:
|
||||||
msg = _('Must include "username" and "password"')
|
msg = _('Must include "username" and "password"')
|
||||||
raise exceptions.ValidationError(msg)
|
raise exceptions.ValidationError(msg)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user