diff options
author | lunnyxiao <xiaolunwen@gmail.com> | 2014-10-11 13:24:36 +0800 |
---|---|---|
committer | lunnyxiao <xiaolunwen@gmail.com> | 2014-10-11 13:24:36 +0800 |
commit | e848b17fab55569b323b9093eb49e9f78df2422c (patch) | |
tree | 67de7fafd003cfe8fb053619dd40cf5c3eade0fc /models/org.go | |
parent | 3600498c8f7177e70f2a876dc00abe55e7ccc818 (diff) | |
download | gitea-e848b17fab55569b323b9093eb49e9f78df2422c.tar.gz gitea-e848b17fab55569b323b9093eb49e9f78df2422c.zip |
bug fixed for #540
Diffstat (limited to 'models/org.go')
-rw-r--r-- | models/org.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/models/org.go b/models/org.go index 31db8e3643..1297cb6d81 100644 --- a/models/org.go +++ b/models/org.go @@ -845,7 +845,8 @@ func IsTeamMember(orgId, teamId, uid int64) bool { // GetTeamMembers returns all members in given team of organization. func GetTeamMembers(orgId, teamId int64) ([]*User, error) { - tus := make([]*TeamUser, 0, 10) + /*tus := make([]*TeamUser, 0, 10) + err := x.Where("org_id=?", orgId).And("team_id=?", teamId).Find(&tus) if err != nil { return nil, err @@ -857,8 +858,11 @@ func GetTeamMembers(orgId, teamId int64) ([]*User, error) { if err != nil { return nil, err } - } - return us, nil + }*/ + + us := make([]*User, 0) + err := x.Sql("select * from user join team_user on team_user.team_id = ? and team_user.uid = user.id", teamId).Find(&us) + return us, err } // GetUserTeams returns all teams that user belongs to in given origanization. |