[Python-modules-commits] [python-social-auth] 59/61: VK API workflow fix if error happens on vk-side

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:14:08 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.13
in repository python-social-auth.

commit bfeb34d0aaef686ea70d627087ff547b5f5d13b6
Author: alrusdi <alrusdi at gmail.com>
Date:   Tue Sep 15 12:59:14 2015 +0500

    VK API workflow fix if error happens on vk-side
---
 social/backends/vk.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/social/backends/vk.py b/social/backends/vk.py
index 1b567bf..da1e19e 100644
--- a/social/backends/vk.py
+++ b/social/backends/vk.py
@@ -111,7 +111,7 @@ class VKOAuth2(BaseOAuth2):
             'fields': fields,
         })
 
-        if data.get('error'):
+        if data and data.get('error'):
             error = data['error']
             msg = error.get('error_msg', 'Unknown error')
             if error.get('error_code') == 5:
@@ -122,7 +122,7 @@ class VKOAuth2(BaseOAuth2):
         if data:
             data = data.get('response')[0]
             data['user_photo'] = data.get('photo')  # Backward compatibility
-        return data
+        return data or {}
 
 
 class VKAppOAuth2(VKOAuth2):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git



More information about the Python-modules-commits mailing list