Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efeccb3

Browse files
committed
email
1 parent 6868813 commit efeccb3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/logic/github.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,9 +733,14 @@ func (self GithubLogic) insertIssue(id int64, title, label string) error {
733733
}
734734

735735
func (self GithubLogic) findUserEmail(githubUser string) string {
736-
uid := DefaultThirdUser.findUid(githubUser, model.BindTypeGithub)
737-
if uid != 0 {
738-
user := DefaultUser.findUser(nil, uid)
736+
bindUser := &model.BindUser{}
737+
MasterDB.Where("username=? AND `type`=?", githubUser, model.BindTypeGithub).Get(bindUser)
738+
if !strings.HasSuffix(bindUser.Email, "@github.com") {
739+
return bindUser.Email
740+
}
741+
742+
if bindUser.Uid != 0 {
743+
user := DefaultUser.findUser(nil, bindUser.Uid)
739744
if !strings.HasSuffix(user.Email, "@github.com") {
740745
return user.Email
741746
}

0 commit comments

Comments
 (0)