Browse Source

Merge branch 'V202108' of git.openi.org.cn:OpenI/aiforge into fix-remote-origin

pull/296/head
lewis 3 years ago
parent
commit
057f06d384
1 changed files with 1 additions and 12 deletions
  1. +1
    -12
      routers/user/setting/profile.go

+ 1
- 12
routers/user/setting/profile.go View File

@@ -90,23 +90,12 @@ func ProfilePost(ctx *context.Context, form auth.UpdateProfileForm) {
}

ctx.User.FullName = form.FullName
ctx.User.Email = form.Email
ctx.User.KeepEmailPrivate = form.KeepEmailPrivate
ctx.User.Website = form.Website
ctx.User.Location = form.Location
ctx.User.Language = form.Language
ctx.User.Description = form.Description
isUsed, err := models.IsEmailUsed(form.Email)
if err != nil {
ctx.ServerError("IsEmailUsed", err)
return
}

if isUsed {
ctx.Flash.Error(ctx.Tr("form.email_been_used"))
ctx.Redirect(setting.AppSubURL + "/user/settings")
return
}

if err := models.UpdateUserSetting(ctx.User); err != nil {
if _, ok := err.(models.ErrEmailAlreadyUsed); ok {


Loading…
Cancel
Save