diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-12-28 17:33:42 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-12-28 17:33:42 -0500 |
commit | b2f98eaee1bfef16bc47c7cbb82619c717057923 (patch) | |
tree | 37ee5ebc292023afe7d73122f56eaf2c0c7f3656 /gitsrht/app.py | |
parent | 7b4692dec8b561fc2b1a36656dc6e5cd87ab5804 (diff) |
Updates per meta.sr.ht API changes
Diffstat (limited to 'gitsrht/app.py')
-rw-r--r-- | gitsrht/app.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gitsrht/app.py b/gitsrht/app.py index 1cea729..f8a4511 100644 --- a/gitsrht/app.py +++ b/gitsrht/app.py @@ -71,13 +71,13 @@ class GitApp(SrhtFlask): return User.query.filter(User.username == username).one_or_none() def lookup_or_register(self, exchange, profile, scopes): - user = User.query.filter(User.username == profile["username"]).first() + user = User.query.filter(User.username == profile["name"]).first() if not user: user = User() db.session.add(user) - user.username = profile.get("username") - user.email = profile.get("email") - user.paid = profile.get("paid") + user.username = profile["name"] + user.email = profile["email"] + user.user_type = profile["user_type"] user.oauth_token = exchange["token"] user.oauth_token_expires = exchange["expires"] user.oauth_token_scopes = scopes |