aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/authtoken
diff options
context:
space:
mode:
authorXavier Ordoquy2012-12-02 12:43:32 +0100
committerXavier Ordoquy2012-12-02 12:43:32 +0100
commit5fad46d7e213afed503b1533515cab96875a5936 (patch)
tree72ab362e86a83ba53361613dbb1e7863889ea749 /rest_framework/authtoken
parentfa53dde576c8733292eacf27c80cf7a0ad222c3b (diff)
parent3114b4fa50e7aee296a0de17e7bcdc0753700ec3 (diff)
downloaddjango-rest-framework-5fad46d7e213afed503b1533515cab96875a5936.tar.bz2
Merge remote-tracking branch 'reference/master' into p3k
Diffstat (limited to 'rest_framework/authtoken')
-rw-r--r--rest_framework/authtoken/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/authtoken/views.py b/rest_framework/authtoken/views.py
index 3ac674e2..cfaacbe9 100644
--- a/rest_framework/authtoken/views.py
+++ b/rest_framework/authtoken/views.py
@@ -18,7 +18,7 @@ class ObtainAuthToken(APIView):
if serializer.is_valid():
token, created = Token.objects.get_or_create(user=serializer.object['user'])
return Response({'token': token.key})
- return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
+ return Response(serializer.errors, status=status.HTTP_401_UNAUTHORIZED)
obtain_auth_token = ObtainAuthToken.as_view()