mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-25 02:56:55 +08:00
Move organization related structs into sub package (#18518)
* Move organization related structs into sub package * Fix test * Fix lint * Move more functions into sub packages * Fix bug * Fix test * Update models/organization/team_repo.go Co-authored-by: KN4CK3R <admin@oldschoolhack.me> * Apply suggestions from code review Co-authored-by: KN4CK3R <admin@oldschoolhack.me> * Fix fmt * Follow suggestion from @Gusted * Fix test * Fix test * Fix bug * Use ctx but db.DefaultContext on routers * Fix bug * Fix bug * fix bug * Update models/organization/team_user.go * Fix bug Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models/organization"
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@ -33,7 +34,7 @@ func TestUserListIsPublicMember(t *testing.T) {
|
||||
}
|
||||
|
||||
func testUserListIsPublicMember(t *testing.T, orgID int64, expected map[int64]bool) {
|
||||
org, err := GetOrgByID(orgID)
|
||||
org, err := organization.GetOrgByID(orgID)
|
||||
assert.NoError(t, err)
|
||||
_, membersIsPublic, err := org.GetMembers()
|
||||
assert.NoError(t, err)
|
||||
@ -60,7 +61,7 @@ func TestUserListIsUserOrgOwner(t *testing.T) {
|
||||
}
|
||||
|
||||
func testUserListIsUserOrgOwner(t *testing.T, orgID int64, expected map[int64]bool) {
|
||||
org, err := GetOrgByID(orgID)
|
||||
org, err := organization.GetOrgByID(orgID)
|
||||
assert.NoError(t, err)
|
||||
members, _, err := org.GetMembers()
|
||||
assert.NoError(t, err)
|
||||
|
Reference in New Issue
Block a user