Skip to content

Commit

Permalink
only return primary email
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsheeh committed Sep 12, 2024
1 parent 0f75300 commit 53994bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ def get_user_name(author_phid: str, session_users: Session) -> Optional[str]:
def get_user_email(author_phid: str, session_users: Session) -> Optional[str]:
try:
user_email = (
session_users.query(UserDb.UserEmail).filter_by(userPHID=author_phid).one()
session_users.query(UserDb.UserEmail)
.filter_by(userPHID=author_phid, isPrimary=1)
.one()
)
return user_email.address
except NoResultFound:
Expand Down

0 comments on commit 53994bf

Please sign in to comment.