diff --git a/routers/web/admin/users.go b/routers/web/admin/users.go index 03c89bdab1..e560a88b4c 100644 --- a/routers/web/admin/users.go +++ b/routers/web/admin/users.go @@ -480,5 +480,5 @@ func DeleteAvatar(ctx *context.Context) { ctx.Flash.Error(err.Error()) } - ctx.Redirect(setting.AppSubURL + "/admin/users/" + strconv.FormatInt(u.ID, 10)) + ctx.JSONRedirect(setting.AppSubURL + "/admin/users/" + strconv.FormatInt(u.ID, 10)) } diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go index 5ae61c79be..957daab646 100644 --- a/routers/web/org/setting.go +++ b/routers/web/org/setting.go @@ -156,7 +156,7 @@ func SettingsDeleteAvatar(ctx *context.Context) { ctx.Flash.Error(err.Error()) } - ctx.Redirect(ctx.Org.OrgLink + "/settings") + ctx.JSONRedirect(ctx.Org.OrgLink + "/settings") } // SettingsDelete response for deleting an organization diff --git a/routers/web/repo/setting/avatar.go b/routers/web/repo/setting/avatar.go index ec673ca288..ae80f1db01 100644 --- a/routers/web/repo/setting/avatar.go +++ b/routers/web/repo/setting/avatar.go @@ -72,5 +72,5 @@ func SettingsDeleteAvatar(ctx *context.Context) { if err := repo_service.DeleteAvatar(ctx, ctx.Repo.Repository); err != nil { ctx.Flash.Error(fmt.Sprintf("DeleteAvatar: %v", err)) } - ctx.Redirect(ctx.Repo.RepoLink + "/settings") + ctx.JSONRedirect(ctx.Repo.RepoLink + "/settings") } diff --git a/routers/web/user/setting/profile.go b/routers/web/user/setting/profile.go index ab7d2e58b3..61089d0947 100644 --- a/routers/web/user/setting/profile.go +++ b/routers/web/user/setting/profile.go @@ -194,7 +194,7 @@ func DeleteAvatar(ctx *context.Context) { ctx.Flash.Error(err.Error()) } - ctx.Redirect(setting.AppSubURL + "/user/settings") + ctx.JSONRedirect(setting.AppSubURL + "/user/settings") } // Organization render all the organization of the user diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 4fea418e6f..e99a4532d3 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -186,7 +186,7 @@