feat: fix bug that can not delete user if user doesn't belong to any group (#3544)

This commit is contained in:
DacongDA 2025-02-02 17:54:05 +08:00 committed by GitHub
parent bbe2162e27
commit e3001671a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -965,13 +965,10 @@ func DeleteUser(user *User) (bool, error) {
return false, err
}
ok, err := userEnforcer.DeleteGroupsForUser(user.GetId())
_, err = userEnforcer.DeleteGroupsForUser(user.GetId())
if err != nil {
return false, err
}
if !ok {
return false, nil
}
organization, err := GetOrganizationByUser(user)
if err != nil {