feat: can pass empty user id on user update (#3443)

This commit is contained in:
Cliff
2024-12-18 02:56:44 +03:00
committed by GitHub
parent b0e318c9db
commit 48adc050d6

View File

@ -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 {