diff options
Diffstat (limited to 'routers/admin/auths.go')
-rw-r--r-- | routers/admin/auths.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/routers/admin/auths.go b/routers/admin/auths.go index c519d5a7e0..b9e86a1ef5 100644 --- a/routers/admin/auths.go +++ b/routers/admin/auths.go @@ -5,6 +5,8 @@ package admin import ( + "fmt" + "github.com/Unknwon/com" "github.com/go-xorm/core" @@ -218,11 +220,13 @@ func DeleteAuthSource(ctx *middleware.Context) { if err = models.DeleteSource(source); err != nil { switch err { case models.ErrAuthenticationUserUsed: - ctx.Flash.Error("form.still_own_user") - ctx.Redirect(setting.AppSubUrl + "/admin/auths/" + ctx.Params(":authid")) + ctx.Flash.Error(ctx.Tr("admin.auths.still_in_used")) default: - ctx.Handle(500, "DeleteSource", err) + ctx.Flash.Error(fmt.Sprintf("DeleteSource: %v", err)) } + ctx.JSON(200, map[string]interface{}{ + "redirect": setting.AppSubUrl + "/admin/auths/" + ctx.Params(":authid"), + }) return } log.Trace("Authentication deleted by admin(%s): %d", ctx.User.Name, source.ID) |