Browse Source

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

for-closed-social
Lunny Xiao 7 years ago
committed by Lauris BH
parent
commit
859b9ad7ea
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      models/org.go

+ 6
- 1
models/org.go View File

@ -453,7 +453,12 @@ func RemoveOrgUser(orgID, userID int64) error {
return err
}
if t.NumMembers == 1 {
return ErrLastOrgOwner{UID: userID}
if err := t.GetMembers(); err != nil {
return err
}
if t.Members[0].ID == userID {
return ErrLastOrgOwner{UID: userID}
}
}
}

Loading…
Cancel
Save