aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/authtoken/views.py
diff options
context:
space:
mode:
authorMarko Tibold2012-12-06 23:47:47 +0100
committerMarko Tibold2012-12-06 23:47:47 +0100
commitc65f22e0e4e5475aebd848b4db6b282ce524a8f3 (patch)
treebc9a30099abfca3aa11bf4969db64db2affe950c /rest_framework/authtoken/views.py
parent899f96ae9186e68009dba5d54246232d34457354 (diff)
parent6a5f4f2a90ab19a8586a9d762c9b2618e8db5c30 (diff)
downloaddjango-rest-framework-c65f22e0e4e5475aebd848b4db6b282ce524a8f3.tar.bz2
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework into #431
Diffstat (limited to 'rest_framework/authtoken/views.py')
-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()