Browse Source

#282

tags/v1.21.8^2
ychao_1983 4 years ago
parent
commit
6bd4d8f21b
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      routers/user/setting/account.go

+ 6
- 0
routers/user/setting/account.go View File

@@ -80,6 +80,12 @@ func EmailPost(ctx *context.Context, form auth.AddEmailForm) {
// Make emailaddress primary.
if ctx.Query("_method") == "PRIMARY" {
if err := models.MakeEmailPrimary(&models.EmailAddress{ID: ctx.QueryInt64("id")}); err != nil {
if _, ok := err.(models.ErrEmailAlreadyUsed); ok {
ctx.Flash.Error(ctx.Tr("form.email_been_used"))
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
return
}

ctx.ServerError("MakeEmailPrimary", err)
return
}


Loading…
Cancel
Save