mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Only update needed columns when update user (#2296)
* only update needed columns when update user * fix missing update_unix column
This commit is contained in:
@@ -156,7 +156,7 @@ func UpdateAvatarSetting(ctx *context.Context, form auth.AvatarForm, ctxUser *mo
|
||||
}
|
||||
}
|
||||
|
||||
if err := models.UpdateUser(ctxUser); err != nil {
|
||||
if err := models.UpdateUserCols(ctxUser, "avatar", "avatar_email", "use_custom_avatar"); err != nil {
|
||||
return fmt.Errorf("UpdateUser: %v", err)
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ func SettingsPasswordPost(ctx *context.Context, form auth.ChangePasswordForm) {
|
||||
return
|
||||
}
|
||||
ctx.User.EncodePasswd()
|
||||
if err := models.UpdateUser(ctx.User); err != nil {
|
||||
if err := models.UpdateUserCols(ctx.User, "salt", "passwd"); err != nil {
|
||||
ctx.Handle(500, "UpdateUser", err)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user