Fix GetUsersByEmails (#34423) (#34425)
Some checks are pending
release-nightly / nightly-binary (push) Waiting to run
release-nightly / nightly-docker-rootful (push) Waiting to run
release-nightly / nightly-docker-rootless (push) Waiting to run

Backport #34423 by wxiaoguang

Fix #34418, fix #34353

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot
2025-05-11 04:42:59 +08:00
committed by GitHub
parent 6d738fecc4
commit a5c7df7a4c
3 changed files with 29 additions and 35 deletions

View File

@ -1198,7 +1198,8 @@ func GetUsersByEmails(ctx context.Context, emails []string) (map[string]*User, e
for _, email := range emailAddresses {
user := users[email.UID]
if user != nil {
results[user.GetEmail()] = user
results[user.Email] = user
results[user.GetPlaceholderEmail()] = user
}
}
}
@ -1208,6 +1209,7 @@ func GetUsersByEmails(ctx context.Context, emails []string) (map[string]*User, e
return nil, err
}
for _, user := range users {
results[user.Email] = user
results[user.GetPlaceholderEmail()] = user
}
return results, nil