projects
/
pgweb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb0f12a
)
Don't crash on completely empty github names
author
Magnus Hagander
<magnus@hagander.net>
Mon, 18 Sep 2017 16:31:48 +0000
(18:31 +0200)
committer
Magnus Hagander
<magnus@hagander.net>
Mon, 18 Sep 2017 16:31:48 +0000
(18:31 +0200)
Sometimes you get a name but it's NULL, sometimes you don't get one. Yay
for consistency, but handle both cases.
pgweb/account/oauthclient.py
patch
|
blob
|
blame
|
history
diff --git
a/pgweb/account/oauthclient.py
b/pgweb/account/oauthclient.py
index ff071a5ae5df00a860394425f458b646a7f7533b..76f0972288da73e234f9fb9e4e8bec16949ee11f 100644
(file)
--- a/
pgweb/account/oauthclient.py
+++ b/
pgweb/account/oauthclient.py
@@
-109,7
+109,7
@@
def oauth_login_github(request):
# Github just returns full name, so we're just going to have to
# split that.
r = oa.get('https://api.github.com/user').json()
- if 'name' in r:
+ if 'name' in r
and r['name']
:
n = r['name'].split(None, 1)
# Some accounts only have one name, extend with an empty
# lastname, so the user can fill it out manually.