fix: do not query user_link for deleted accounts (#12112)

This commit is contained in:
Steven Masley
2024-02-13 13:02:21 -06:00
committed by GitHub
parent 06f3ab1206
commit 5d483a7ea1
4 changed files with 39 additions and 8 deletions

View File

@ -3787,6 +3787,10 @@ func (q *FakeQuerier) GetUserLinkByLinkedID(_ context.Context, id string) (datab
defer q.mutex.RUnlock()
for _, link := range q.userLinks {
user, err := q.getUserByIDNoLock(link.UserID)
if err == nil && user.Deleted {
continue
}
if link.LinkedID == id {
return link, nil
}