mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
feat: can pass empty user id on user update (#3443)
This commit is contained in:
@ -679,6 +679,10 @@ func UpdateUser(id string, user *User, columns []string, isAdmin bool) (bool, er
|
||||
user.Password = oldUser.Password
|
||||
}
|
||||
|
||||
if user.Id != oldUser.Id && user.Id == "" {
|
||||
user.Id = oldUser.Id
|
||||
}
|
||||
|
||||
if user.Avatar != oldUser.Avatar && user.Avatar != "" && user.PermanentAvatar != "*" {
|
||||
user.PermanentAvatar, err = getPermanentAvatarUrl(user.Owner, user.Name, user.Avatar, false)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user