aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/admin/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/admin/user.go')
-rw-r--r--routers/api/v1/admin/user.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go
index e5a75da759..2d585b6040 100644
--- a/routers/api/v1/admin/user.go
+++ b/routers/api/v1/admin/user.go
@@ -11,6 +11,7 @@ import (
"net/http"
"code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/models/login"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/convert"
"code.gitea.io/gitea/modules/log"
@@ -27,12 +28,12 @@ func parseLoginSource(ctx *context.APIContext, u *models.User, sourceID int64, l
return
}
- source, err := models.GetLoginSourceByID(sourceID)
+ source, err := login.GetSourceByID(sourceID)
if err != nil {
- if models.IsErrLoginSourceNotExist(err) {
+ if login.IsErrSourceNotExist(err) {
ctx.Error(http.StatusUnprocessableEntity, "", err)
} else {
- ctx.Error(http.StatusInternalServerError, "GetLoginSourceByID", err)
+ ctx.Error(http.StatusInternalServerError, "login.GetSourceByID", err)
}
return
}
@@ -74,7 +75,7 @@ func CreateUser(ctx *context.APIContext) {
Passwd: form.Password,
MustChangePassword: true,
IsActive: true,
- LoginType: models.LoginPlain,
+ LoginType: login.Plain,
}
if form.MustChangePassword != nil {
u.MustChangePassword = *form.MustChangePassword