Skip to content

Commit

Permalink
Partially revert afef2bf
Browse files Browse the repository at this point in the history
* Allow `GetAuthToken.serializer_class` to be overriden by subclasses.
  • Loading branch information
LilyFoote committed Apr 9, 2015
1 parent 3e70fb5 commit a6d3c98
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions user_management/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.utils.translation import ugettext_lazy as _
from rest_framework import generics, response, status, views
from rest_framework.authentication import get_authorization_header
from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.permissions import AllowAny, IsAuthenticated

Expand Down Expand Up @@ -35,7 +34,7 @@ class GetAuthToken(ObtainAuthToken):
def post(self, request):
"""Create auth token. Differs from DRF that it always creates new token
but not re-using them."""
serializer = AuthTokenSerializer(data=request.DATA)
serializer = self.serializer_class(data=request.DATA)
if serializer.is_valid():
user = serializer.validated_data['user']
signals.user_logged_in.send(type(self), user=user, request=request)
Expand Down

0 comments on commit a6d3c98

Please sign in to comment.