Handle the case where we have lookup_user but no username
This commit is contained in:
parent
c4f938898a
commit
eaf81959f5
2 changed files with 26 additions and 1 deletions
|
@ -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']
|
||||
|
|
Reference in a new issue