catching incorrect input

This commit is contained in:
Philippe Luickx 2015-08-13 10:56:25 +03:00
parent 5a6c8f549b
commit 64ab8be2f0

View File

@ -85,6 +85,9 @@ class SocialLoginSerializer(serializers.Serializer):
)
token = client.get_access_token(code)
access_token = token['access_token']
else:
raise serializers.ValidationError('Incorrect input. access_token or code is required.')
token = adapter.parse_token({'access_token': access_token})
token.app = app