Merge pull request #2060 from coreos-inc/gitlab-user-exception

Fix TypeError in Gitlab trigger when user not found
This commit is contained in:
josephschorr 2016-10-31 13:37:45 -04:00 committed by GitHub
commit 0954240ccb

View file

@ -337,8 +337,11 @@ class GitLabBuildTrigger(BuildTriggerHandler):
def lookup_user(self, email):
gl_client = self._get_authorized_client()
try:
[user] = gl_client.getusers(search=email)
result = gl_client.getusers(search=email)
if result is False:
return None
[user] = result
return {
'username': user['username'],
'html_url': gl_client.host + '/' + user['username'],