diff --git a/github2fedmsg/views/webhooks.py b/github2fedmsg/views/webhooks.py index be6b707..0637143 100644 --- a/github2fedmsg/views/webhooks.py +++ b/github2fedmsg/views/webhooks.py @@ -167,10 +167,19 @@ def build_fas_lookup(payload): usernames = set() # Trawl through every possible corner we can to find github usernames + # Fix for https://pagure.io/fedora-infrastructure/issue/11776 if 'commits' in payload: for commit in payload['commits']: - usernames.add(commit['committer']['username']) - usernames.add(commit['author']['username']) + if 'committer' in commit: + if 'username' in commit['committer']: + usernames.add(commit['committer']['username']) + elif 'name' in commit['committer']: + usernames.add(commit['committer']['name']) + if 'author' in commit: + if 'username' in commit['author']: + usernames.add(commit['author']['username']) + elif 'name' in commit['author']: + usernames.add(commit['author']['name']) if 'pusher' in payload: usernames.add(payload['pusher']['name'])