dahlia/wsgi-oauth2 — pull request #9 by aaugustin (2014-08-09 19:47:37+00:00)
Title: Support users who didn't declare their name on GitHub.

A user couldn't log in and the logs contained the following stack trace:

Traceback (most recent call last):
File "/path/to/venv/lib/python2.6/site-packages/wsgioauth2.py", line 542, in __call__
self.client.load_username(access_token)
File "/path/to/venv/lib/python2.6/site-packages/wsgioauth2.py", line 262, in load_username
self.service.load_username(access_token)
File "/path/to/venv/lib/python2.6/site-packages/wsgioauth2.py", line 158, in load_username
access_token["name"] = response["name"]
KeyError: 'name'

It seems that GitHub omits the 'name' attribute in the user JSON when the user doesn't declare their name, which is optional when creating an account.