mirror of https://github.com/go-gitea/gitea.git
fix org owner cannot be removed if there is not in owner team (#3164)
parent
9f033bf2b5
commit
859b9ad7ea
|
@ -453,7 +453,12 @@ func RemoveOrgUser(orgID, userID int64) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if t.NumMembers == 1 {
|
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…
Reference in New Issue