aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/authtoken/serializers.py
diff options
context:
space:
mode:
authorTom Christie2014-09-02 17:41:23 +0100
committerTom Christie2014-09-02 17:41:23 +0100
commitf2852811f93863f2eed04d51eeb7ef27716b2409 (patch)
tree45799932849f81d45d77edc53cb00269465ba0f1 /rest_framework/authtoken/serializers.py
parentec096a1caceff6a4f5c75a152dd1c7bea9ed281d (diff)
downloaddjango-rest-framework-f2852811f93863f2eed04d51eeb7ef27716b2409.tar.bz2
Getting tests passing
Diffstat (limited to 'rest_framework/authtoken/serializers.py')
-rw-r--r--rest_framework/authtoken/serializers.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rest_framework/authtoken/serializers.py b/rest_framework/authtoken/serializers.py
index 99e99ae3..edeae857 100644
--- a/rest_framework/authtoken/serializers.py
+++ b/rest_framework/authtoken/serializers.py
@@ -19,11 +19,12 @@ class AuthTokenSerializer(serializers.Serializer):
if not user.is_active:
msg = _('User account is disabled.')
raise serializers.ValidationError(msg)
- attrs['user'] = user
- return attrs
else:
msg = _('Unable to login with provided credentials.')
raise serializers.ValidationError(msg)
else:
msg = _('Must include "username" and "password"')
raise serializers.ValidationError(msg)
+
+ attrs['user'] = user
+ return attrs