Browse Source

Verify list len before use it with IN (#3423)

pull/3432/head
Thibault Meyer 9 years ago committed by 无闻
parent
commit
8ad92bb8a4
  1. 3
      models/org.go

3
models/org.go

@ -414,9 +414,12 @@ func RemoveOrgUser(orgID, userID int64) error {
return err return err
} }
} }
if len(repoIDs) > 0 {
if _, err = sess.Where("user_id = ?", user.ID).In("repo_id", repoIDs).Delete(new(Access)); err != nil { if _, err = sess.Where("user_id = ?", user.ID).In("repo_id", repoIDs).Delete(new(Access)); err != nil {
return err return err
} }
}
// Delete member in his/her teams. // Delete member in his/her teams.
teams, err := getUserTeams(sess, org.ID, user.ID) teams, err := getUserTeams(sess, org.ID, user.ID)

Loading…
Cancel
Save