refactor: remove redundant check as suggested by @maxim-kht

This commit is contained in:
Ankit Popli 2016-11-28 11:42:06 +05:30
parent 4599adf92b
commit 139dd4a4e4
No known key found for this signature in database
GPG Key ID: 1E656D5DEDF10ACD

View File

@ -63,11 +63,11 @@ class SocialLoginSerializer(serializers.Serializer):
# http://stackoverflow.com/questions/8666316/facebook-oauth-2-0-code-and-token # http://stackoverflow.com/questions/8666316/facebook-oauth-2-0-code-and-token
# Case 1: We received the access_token # Case 1: We received the access_token
if 'access_token' in attrs and attrs.get('access_token'): if attrs.get('access_token'):
access_token = attrs.get('access_token') access_token = attrs.get('access_token')
# Case 2: We received the authorization code # Case 2: We received the authorization code
elif 'code' in attrs and attrs.get('code'): elif attrs.get('code'):
self.callback_url = getattr(view, 'callback_url', None) self.callback_url = getattr(view, 'callback_url', None)
self.client_class = getattr(view, 'client_class', None) self.client_class = getattr(view, 'client_class', None)