diff options
Diffstat (limited to 'routers/admin/users.go')
-rw-r--r-- | routers/admin/users.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go index 4f57407a2a..ddd12a8b22 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -222,11 +222,11 @@ func DeleteUser(ctx *middleware.Context) { } if err = models.DeleteUser(u); err != nil { - switch err { - case models.ErrUserOwnRepos: + switch { + case models.IsErrUserOwnRepos(err): ctx.Flash.Error(ctx.Tr("admin.users.still_own_repo")) ctx.Redirect(setting.AppSubUrl + "/admin/users/" + ctx.Params(":userid")) - case models.ErrUserHasOrgs: + case models.IsErrUserHasOrgs(err): ctx.Flash.Error(ctx.Tr("admin.users.still_has_org")) ctx.Redirect(setting.AppSubUrl + "/admin/users/" + ctx.Params(":userid")) default: |