Fix TypeError in Gitlab trigger when user not found

Fixes #2055
This commit is contained in:
Joseph Schorr 2016-10-31 13:31:26 -04:00
parent 48935d7208
commit 99ea0a9009

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'],