Fix Github Trigger handling when there is no committer

This commit is contained in:
Joseph Schorr 2015-03-17 16:54:18 -04:00
parent 699cb9a5da
commit 56be893d7e

View file

@ -318,21 +318,27 @@ class GithubBuildTrigger(BuildTrigger):
logger.exception('Could not load data for commit')
return
return {
commit_info = {
'url': commit.html_url,
'message': commit.commit.message,
'author': {
'date': commit.last_modified
}
if commit.author:
commit_info['author'] = {
'username': commit.author.login,
'avatar_url': commit.author.avatar_url,
'url': commit.author.html_url
},
'committer': {
}
if commit.committer:
commit_info['committer'] = {
'username': commit.committer.login,
'avatar_url': commit.committer.avatar_url,
'url': commit.committer.html_url
},
'date': commit.last_modified
}
}
return commit_info
@staticmethod
def _prepare_build(config, repo, commit_sha, build_name, ref):