Use github's anonymous email standin when github auth user has email as private

这个提交包含在:
Chase Sterling 2016-07-13 22:47:24 -04:00
父节点 7a7dfd5097
当前提交 2d3de77bf6
共有 1 个文件被更改,包括 3 次插入1 次删除

查看文件

@ -40,7 +40,7 @@ providers = {
'field_map': {
'id': 'id',
'username': 'login',
'email': 'email'
'email': lambda(data): data.get('email') or data['login'] + '@users.noreply.github.com'
},
'token_name': 'access_token'
},
@ -118,6 +118,8 @@ class User(BaseUser):
def get_value(d, key):
if isinstance(key, basestring):
return d.get(key)
elif callable(key):
return key(d)
# key should be list here
val = d.get(key.pop(0))
if len(key) == 0: