aboutsummaryrefslogtreecommitdiffstats
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.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/web/admin/users.go b/routers/web/admin/users.go
index a6b0b5c78b..1eaa37bfbd 100644
--- a/routers/web/admin/users.go
+++ b/routers/web/admin/users.go
@@ -11,10 +11,10 @@ import (
"strconv"
"strings"
- "code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
org_model "code.gitea.io/gitea/models/organization"
+ packages_model "code.gitea.io/gitea/models/packages"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/auth/password"
@@ -446,7 +446,7 @@ func EditUserPost(ctx *context.Context) {
}
if err := user_service.UpdateUser(ctx, u, opts); err != nil {
- if models.IsErrDeleteLastAdminUser(err) {
+ if user_model.IsErrDeleteLastAdminUser(err) {
ctx.RenderWithErr(ctx.Tr("auth.last_admin"), tplUserEdit, &form)
} else {
ctx.ServerError("UpdateUser", err)
@@ -501,16 +501,16 @@ func DeleteUser(ctx *context.Context) {
if err = user_service.DeleteUser(ctx, u, ctx.FormBool("purge")); err != nil {
switch {
- case models.IsErrUserOwnRepos(err):
+ case repo_model.IsErrUserOwnRepos(err):
ctx.Flash.Error(ctx.Tr("admin.users.still_own_repo"))
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
- case models.IsErrUserHasOrgs(err):
+ case org_model.IsErrUserHasOrgs(err):
ctx.Flash.Error(ctx.Tr("admin.users.still_has_org"))
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
- case models.IsErrUserOwnPackages(err):
+ case packages_model.IsErrUserOwnPackages(err):
ctx.Flash.Error(ctx.Tr("admin.users.still_own_packages"))
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
- case models.IsErrDeleteLastAdminUser(err):
+ case user_model.IsErrDeleteLastAdminUser(err):
ctx.Flash.Error(ctx.Tr("auth.last_admin"))
ctx.Redirect(setting.AppSubURL + "/-/admin/users/" + url.PathEscape(ctx.PathParam(":userid")))
default: