summaryrefslogtreecommitdiffstats
path: root/routers/web/admin/users.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/admin/users.go')
-rw-r--r--routers/web/admin/users.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/web/admin/users.go b/routers/web/admin/users.go
index 454e4ce07e..fcfea53801 100644
--- a/routers/web/admin/users.go
+++ b/routers/web/admin/users.go
@@ -424,6 +424,11 @@ func DeleteUser(ctx *context.Context) {
ctx.JSON(http.StatusOK, map[string]interface{}{
"redirect": setting.AppSubURL + "/admin/users/" + url.PathEscape(ctx.Params(":userid")),
})
+ case models.IsErrUserOwnPackages(err):
+ ctx.Flash.Error(ctx.Tr("admin.users.still_own_packages"))
+ ctx.JSON(http.StatusOK, map[string]interface{}{
+ "redirect": setting.AppSubURL + "/admin/users/" + ctx.Params(":userid"),
+ })
default:
ctx.ServerError("DeleteUser", err)
}