fix org owner cannot be removed if there is not in owner team (#3164)

tokarchuk/v1.17
Lunny Xiao 7 years ago committed by Lauris BH
parent 9f033bf2b5
commit 859b9ad7ea
  1. 5
      models/org.go

@ -453,9 +453,14 @@ func RemoveOrgUser(orgID, userID int64) error {
return err
}
if t.NumMembers == 1 {
if err := t.GetMembers(); err != nil {
return err
}
if t.Members[0].ID == userID {
return ErrLastOrgOwner{UID: userID}
}
}
}
sess := x.NewSession()
defer sess.Close()

Loading…
Cancel
Save