aboutsummaryrefslogtreecommitdiff
path: root/models/org_team.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-27 13:13:04 -0400
committerUnknwon <u@gogs.io>2017-03-27 13:13:04 -0400
commit1038916460a7ed2fa559bcf2f14b2eecb6ddaad6 (patch)
treeb1a537a8c25d0331e925c5d2600adf62294be34f /models/org_team.go
parent73de9f9d6ac806634b22c150d42c66cb942d1088 (diff)
models/protect_branch: fix whitelist with invalid 'protect_branch_id' (#4333)
If user creates a protect branch for the first time (which has ID=0), it generates invalid whitelist records with 'protect_branch_id=0'. This prevents future updates of protect branch whitelist. Migration: remove existing invalid protect branch whitelist records.
Diffstat (limited to 'models/org_team.go')
-rw-r--r--models/org_team.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/org_team.go b/models/org_team.go
index 816f2370..a7fe3a33 100644
--- a/models/org_team.go
+++ b/models/org_team.go
@@ -424,7 +424,7 @@ func IsTeamMember(orgID, teamID, uid int64) bool {
func getTeamMembers(e Engine, teamID int64) (_ []*User, err error) {
teamUsers := make([]*TeamUser, 0, 10)
- if err = e.Sql("SELECT `id`, `org_id`, `team_id`, `uid` FROM `team_user` WHERE team_id=?", teamID).
+ if err = e.Sql("SELECT `id`, `org_id`, `team_id`, `uid` FROM `team_user` WHERE team_id = ?", teamID).
Find(&teamUsers); err != nil {
return nil, fmt.Errorf("get team-users: %v", err)
}