mirror of
https://github.com/gogs/gogs.git
synced 2026-05-09 12:56:01 +02:00
getOrgUsersByOrgID
This commit is contained in:
@@ -1180,12 +1180,13 @@ func updateIssueMentions(e Engine, issueID int64, mentions []string) error {
|
||||
continue
|
||||
}
|
||||
|
||||
memberIDs := make([]int64, 0, user.NumMembers)
|
||||
orgUsers, err := getOrgUsersByOrgID(e, user.ID, 0)
|
||||
orgUsers := make([]*OrgUser, 0, 10)
|
||||
err := e.Where("org_id=?", user.ID).Find(&orgUsers)
|
||||
if err != nil {
|
||||
return fmt.Errorf("getOrgUsersByOrgID [%d]: %v", user.ID, err)
|
||||
}
|
||||
|
||||
memberIDs := make([]int64, 0, user.NumMembers)
|
||||
for _, orgUser := range orgUsers {
|
||||
memberIDs = append(memberIDs, orgUser.ID)
|
||||
}
|
||||
|
||||
@@ -10,17 +10,6 @@ import (
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
// getOrgUsersByOrgID returns all organization-user relations by organization ID.
|
||||
func getOrgUsersByOrgID(e Engine, orgID int64, limit int) ([]*OrgUser, error) {
|
||||
orgUsers := make([]*OrgUser, 0, 10)
|
||||
|
||||
sess := e.Where("org_id=?", orgID)
|
||||
if limit > 0 {
|
||||
sess = sess.Limit(limit)
|
||||
}
|
||||
return orgUsers, sess.Find(&orgUsers)
|
||||
}
|
||||
|
||||
// GetUserMirrorRepositories returns mirror repositories of the organization which the user has access to.
|
||||
func (u *User) GetUserMirrorRepositories(userID int64) ([]*Repository, error) {
|
||||
teamIDs, err := u.GetUserTeamIDs(userID)
|
||||
|
||||
Reference in New Issue
Block a user