From c7fba332e618c5cc98c6571db876bc02febc2cb8 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 29 Oct 2015 14:14:05 -0400 Subject: [PATCH] fix handling missing authors for Bitbucket The author was accidentally always being initialized as a JSONPathDict, thus the `if` expression following was always true. Fixes #733. --- buildtrigger/bitbuckethandler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildtrigger/bitbuckethandler.py b/buildtrigger/bitbuckethandler.py index adb7e10d1..089271355 100644 --- a/buildtrigger/bitbuckethandler.py +++ b/buildtrigger/bitbuckethandler.py @@ -200,8 +200,8 @@ def get_transformed_commit_info(bb_commit, ref, default_branch, repository_name, match = _RAW_AUTHOR_REGEX.match(commit['raw_author']) if match: - email_address = match.group(1) - author_info = JSONPathDict(lookup_author(email_address)) + author = lookup_author(match.group(1)) + author_info = JSONPathDict(author) if author is not None else None if author_info: config['commit_info.author.username'] = author_info['user.username'] config['commit_info.author.url'] = 'https://bitbucket.org/%s/' % author_info['user.username']