1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

Fix potential assignee query for repo (#18994) (#18999)

* Fix potential assignee query for repo

* Add tests for `GetRepoAssignees`

- As per https://github.com/go-gitea/gitea/pull/18994#issuecomment-1058506640

Co-authored-by: Gusted <williamzijl7@hotmail.com>
This commit is contained in:
Otto Richter (fnetX)
2022-03-04 17:12:34 +01:00
committed by GitHub
parent ae9c51df7c
commit da985b25ce
2 changed files with 19 additions and 1 deletions

View File

@@ -153,7 +153,7 @@ func getRepoAssignees(ctx context.Context, repo *repo_model.Repository) (_ []*us
userIDs := make([]int64, 0, 10)
if err = e.Table("access").
Where("repo_id = ? AND mode >= ?", repo.ID, perm.AccessModeWrite).
Select("id").
Select("user_id").
Find(&userIDs); err != nil {
return nil, err
}