You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Index: social/backends/weibo.py
===================================================================
--- social/backends/weibo.py (revision 101)
+++ social/backends/weibo.py (working copy)
@@ -27,7 +27,7 @@
"""Return user details from Weibo. API URL is:
https://api.weibo.com/2/users/show.json/?uid=<UID>&access_token=<TOKEN>
"""
- return {'username': response.get("name", ""),
+ return {'username': response.get("domain", ""),
'first_name': response.get('screen_name', '')}
please change the username column in admin from "name" to "domain" for weibo backend. the response key "name" from weibo usually contain chinese characters, which is not allow to be the username 's content of table auth_user. it may cause an invalid warning when people try to change it to another chinese word. the "domain" key contain an weibo account name whom the user register for themself as an identity string which always just contain english alphabet word [a-zA-Z]+ and digit [0-9]+ is a more proper choice for the username .
since i don't have the permission to merge this fix to the master branch, i wish someone can help me apply this fix code to the master branch.
The text was updated successfully, but these errors were encountered:
@sgxiao, I've added a setting to control this behavior keeping the name as the default value for backward compatibility. If you want to define the domain as the source of username it enough to define the setting SOCIAL_AUTH_WEIBO_DOMAIN_AS_USERNAME = True. Docs at http://psa.matiasaguirre.net/docs/backends/weibo.html
please change the username column in admin from "name" to "domain" for weibo backend. the response key "name" from weibo usually contain chinese characters, which is not allow to be the username 's content of table auth_user. it may cause an invalid warning when people try to change it to another chinese word. the "domain" key contain an weibo account name whom the user register for themself as an identity string which always just contain english alphabet word [a-zA-Z]+ and digit [0-9]+ is a more proper choice for the username .
since i don't have the permission to merge this fix to the master branch, i wish someone can help me apply this fix code to the master branch.
The text was updated successfully, but these errors were encountered: