Skip to content

Commit

Permalink
Merge pull request #3986 from nickmango/bug/github-search-none
Browse files Browse the repository at this point in the history
[#3884] Bug/Fetching user by email
  • Loading branch information
nickmango authored Jun 9, 2023
2 parents 694dd80 + 62916df commit 71d4ad9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cla-backend/cla/models/github_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,9 @@ def get_github_user_by_email(self, email, installation_id):
try:
cla.log.debug('Searching for GitHub user by email handle: %s', email)
users_by_email = self.client.search_users(f"{email} in:email")
if len(users_by_email) == 0:
cla.log.debug('No GitHub user found with email handle: %s', email)
return None
return users_by_email[0]
except UnknownObjectException:
cla.log.error('Could not find GitHub user %s' ,
Expand Down

0 comments on commit 71d4ad9

Please sign in to comment.