[Python-modules-commits] [python-social-auth] 317/322: Coding style

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


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

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

commit 278945f82d19588c4a6c7e9a95ff1bafe944036c
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Fri May 29 18:01:05 2015 -0300

    Coding style
---
 social/backends/weixin.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/social/backends/weixin.py b/social/backends/weixin.py
index 5170caf..b1308f3 100644
--- a/social/backends/weixin.py
+++ b/social/backends/weixin.py
@@ -30,20 +30,22 @@ class WeixinOAuth2(BaseOAuth2):
             username = response.get('domain', '')
         else:
             username = response.get('nickname', '')
-        profile_image_url = response.get('headimgurl', '')
-        return {'username': username, 'profile_image_url': profile_image_url}
+        return {
+            'username': username,
+            'profile_image_url': response.get('headimgurl', '')
+        }
 
     def user_data(self, access_token, *args, **kwargs):
-        data = self.get_json('https://api.weixin.qq.com/sns/userinfo',
-                             params={'access_token': access_token,
-                                     'openid': kwargs['response']['openid']})
+        data = self.get_json('https://api.weixin.qq.com/sns/userinfo', params={
+            'access_token': access_token,
+            'openid': kwargs['response']['openid']
+        })
         nickname = data.get('nickname')
         if nickname:
             # weixin api has some encode bug, here need handle
             data['nickname'] = nickname.encode('raw_unicode_escape').decode('utf-8')
         return data
 
-
     def auth_params(self, state=None):
         appid, secret = self.get_key_and_secret()
         params = {

-- 
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