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