Merge remote-tracking branch 'origin/master' into update_flask

This commit is contained in:
Chase Sterling 2016-07-28 10:22:37 -04:00
джерело 36d3fb7215 065a8c3327
коміт f175f12970
2 змінених файлів з 4 додано та 2 видалено

@ -23,7 +23,7 @@ class Config(object):
BASE_URL = 'http://localhost'
SITE_TITLE = "Realms"
# https://pythonhosted.org/Flask-SQLAlchemy/config.html#connection-uri-format
# http://flask-sqlalchemy.pocoo.org/config/#connection-uri-format
DB_URI = 'sqlite:////tmp/wiki.db'
# DB_URI = 'mysql://scott:tiger@localhost/mydatabase'
# DB_URI = 'postgresql://scott:tiger@localhost/mydatabase'

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