Handle the case where we have lookup_user but no username

This commit is contained in:
Joseph Schorr 2015-09-28 17:12:56 -04:00
parent c4f938898a
commit eaf81959f5
2 changed files with 26 additions and 1 deletions

View file

@ -118,7 +118,8 @@ def get_transformed_webhook_payload(gh_payload, default_branch=None, lookup_user
# Note: GitHub doesn't always return the extra information for users, so we do the lookup
# manually if possible.
if lookup_user and not payload.get('head_commit.author.html_url'):
if (lookup_user and not payload.get('head_commit.author.html_url') and
payload.get('head_commit.author.username')):
author_info = lookup_user(payload['head_commit.author.username'])
if author_info:
config['commit_info.author.url'] = author_info['html_url']