aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/transfer.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/transfer.go')
-rw-r--r--routers/api/v1/repo/transfer.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/api/v1/repo/transfer.go b/routers/api/v1/repo/transfer.go
index f16e2bb081..b3913bcd34 100644
--- a/routers/api/v1/repo/transfer.go
+++ b/routers/api/v1/repo/transfer.go
@@ -9,6 +9,7 @@ import (
"net/http"
"code.gitea.io/gitea/models"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/convert"
"code.gitea.io/gitea/modules/log"
@@ -53,9 +54,9 @@ func Transfer(ctx *context.APIContext) {
opts := web.GetForm(ctx).(*api.TransferRepoOption)
- newOwner, err := models.GetUserByName(opts.NewOwner)
+ newOwner, err := user_model.GetUserByName(opts.NewOwner)
if err != nil {
- if models.IsErrUserNotExist(err) {
+ if user_model.IsErrUserNotExist(err) {
ctx.Error(http.StatusNotFound, "", "The new owner does not exist or cannot be found")
return
}
@@ -63,7 +64,7 @@ func Transfer(ctx *context.APIContext) {
return
}
- if newOwner.Type == models.UserTypeOrganization {
+ if newOwner.Type == user_model.UserTypeOrganization {
if !ctx.User.IsAdmin && newOwner.Visibility == api.VisibleTypePrivate && !models.OrgFromUser(newOwner).HasMemberWithUserID(ctx.User.ID) {
// The user shouldn't know about this organization
ctx.Error(http.StatusNotFound, "", "The new owner does not exist or cannot be found")