diff options
| author | Tom Christie | 2014-10-17 13:23:14 +0100 | 
|---|---|---|
| committer | Tom Christie | 2014-10-17 13:23:14 +0100 | 
| commit | 05cbec9dd7f9f0b6a9b59b29ac6c9272b6ae50d8 (patch) | |
| tree | de0da30019c3f0d3ac34bfa3317767fc6e6ad36f /rest_framework/authtoken | |
| parent | 5882a7a9d52de1084d2be68adc73dc19bc706e4a (diff) | |
| download | django-rest-framework-05cbec9dd7f9f0b6a9b59b29ac6c9272b6ae50d8.tar.bz2 | |
Use serializers.ValidationError
Diffstat (limited to 'rest_framework/authtoken')
| -rw-r--r-- | rest_framework/authtoken/serializers.py | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/rest_framework/authtoken/serializers.py b/rest_framework/authtoken/serializers.py index a808d0a3..f31dded1 100644 --- a/rest_framework/authtoken/serializers.py +++ b/rest_framework/authtoken/serializers.py @@ -18,13 +18,13 @@ class AuthTokenSerializer(serializers.Serializer):              if user:                  if not user.is_active:                      msg = _('User account is disabled.') -                    raise exceptions.ValidationFailed(msg) +                    raise exceptions.ValidationError(msg)              else:                  msg = _('Unable to log in with provided credentials.') -                raise exceptions.ValidationFailed(msg) +                raise exceptions.ValidationError(msg)          else:              msg = _('Must include "username" and "password"') -            raise exceptions.ValidationFailed(msg) +            raise exceptions.ValidationError(msg)          attrs['user'] = user          return attrs | 
