Removed unused code.

This commit is contained in:
Mark Winterbottom 2018-10-18 08:09:13 +01:00
parent 28040b3bda
commit d1d1abb377
No known key found for this signature in database
GPG Key ID: 766B4B600637B315

View File

@ -16,7 +16,7 @@ class AuthTokenSerializer(serializers.Serializer):
username = attrs.get('username')
password = attrs.get('password')
if username and password:
user = authenticate(request=self.context.get('request'),
username=username, password=password)
@ -26,9 +26,7 @@ class AuthTokenSerializer(serializers.Serializer):
if not user:
msg = _('Unable to log in with provided credentials.')
raise serializers.ValidationError(msg, code='authorization')
else:
msg = _('Must include "username" and "password".')
raise serializers.ValidationError(msg, code='authorization')
attrs['user'] = user
return attrs