Fix KeyError in Github trigger setup

Fixes #2128
This commit is contained in:
Joseph Schorr 2016-11-16 15:54:08 -05:00
parent 1346b7fb63
commit 8c78d967f8

View file

@ -358,10 +358,13 @@ class GithubBuildTrigger(BuildTriggerHandler):
[{'kind': 'tag', 'name': tag} for tag in tags])
config = self.config
source = config.get('build_source')
if source is None:
return []
if field_name == 'tag_name':
try:
gh_client = self._get_client()
source = config['build_source']
repo = gh_client.get_repo(source)
gh_tags = repo.get_tags()
if limit:
@ -378,7 +381,6 @@ class GithubBuildTrigger(BuildTriggerHandler):
if field_name == 'branch_name':
try:
gh_client = self._get_client()
source = config['build_source']
repo = gh_client.get_repo(source)
gh_branches = repo.get_branches()
if limit: