diff options
author | zeripath <art27@cantab.net> | 2022-02-02 08:40:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 08:40:04 +0000 |
commit | 9c318a17f576887736e97c7bc2971d2ad7579a33 (patch) | |
tree | 3eeb48ec3f45a6401215cc2b71761ba76d9a0af9 /modules | |
parent | 72fa108cbc0a3a7582ca7aaefc46787ec096640a (diff) | |
download | gitea-9c318a17f576887736e97c7bc2971d2ad7579a33.tar.gz gitea-9c318a17f576887736e97c7bc2971d2ad7579a33.zip |
Add `GetUserTeams` (#18499) (#18531)
Backport #18499
* Correct use `UserID` in `SearchTeams`
- Use `UserID` in the `SearchTeams` function, currently it was useless
to pass such information. Now it does a INNER statement to `team_user`
which obtains UserID -> TeamID data.
- Make OrgID optional.
- Resolves #18484
* Seperate searching specific user
* Add condition back
* Use correct struct type
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/repository/create_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/repository/create_test.go b/modules/repository/create_test.go index ed890ace43..4e232a8609 100644 --- a/modules/repository/create_test.go +++ b/modules/repository/create_test.go @@ -23,7 +23,7 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) { testTeamRepositories := func(teamID int64, repoIds []int64) { team := unittest.AssertExistsAndLoadBean(t, &models.Team{ID: teamID}).(*models.Team) - assert.NoError(t, team.GetRepositories(&models.SearchTeamOptions{}), "%s: GetRepositories", team.Name) + assert.NoError(t, team.GetRepositories(&models.SearchOrgTeamOptions{}), "%s: GetRepositories", team.Name) assert.Len(t, team.Repos, team.NumRepos, "%s: len repo", team.Name) assert.Len(t, team.Repos, len(repoIds), "%s: repo count", team.Name) for i, rid := range repoIds { |