Browse Source

#282 邮件地址已被使用,界面已经不能修改邮件地址,去掉邮件的检查

tags/v1.21.8^2
ychao_1983 4 years ago
parent
commit
efd1ab7227
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.FullName = form.FullName
ctx.User.Email = form.Email
ctx.User.KeepEmailPrivate = form.KeepEmailPrivate ctx.User.KeepEmailPrivate = form.KeepEmailPrivate
ctx.User.Website = form.Website ctx.User.Website = form.Website
ctx.User.Location = form.Location ctx.User.Location = form.Location
ctx.User.Language = form.Language ctx.User.Language = form.Language
ctx.User.Description = form.Description 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 err := models.UpdateUserSetting(ctx.User); err != nil {
if _, ok := err.(models.ErrEmailAlreadyUsed); ok { if _, ok := err.(models.ErrEmailAlreadyUsed); ok {


Loading…
Cancel
Save