diff options
Diffstat (limited to 'routers/web')
-rw-r--r-- | routers/web/admin/admin.go | 2 | ||||
-rw-r--r-- | routers/web/admin/repos.go | 7 | ||||
-rw-r--r-- | routers/web/repo/setting.go | 2 | ||||
-rw-r--r-- | routers/web/user/setting/adopt.go | 6 |
4 files changed, 8 insertions, 9 deletions
diff --git a/routers/web/admin/admin.go b/routers/web/admin/admin.go index 223114dae1..8cbe852718 100644 --- a/routers/web/admin/admin.go +++ b/routers/web/admin/admin.go @@ -18,7 +18,6 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" - "code.gitea.io/gitea/modules/cron" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/json" "code.gitea.io/gitea/modules/log" @@ -28,6 +27,7 @@ import ( "code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/modules/updatechecker" "code.gitea.io/gitea/modules/web" + "code.gitea.io/gitea/services/cron" "code.gitea.io/gitea/services/forms" "code.gitea.io/gitea/services/mailer" diff --git a/routers/web/admin/repos.go b/routers/web/admin/repos.go index 2f4d182af8..a13f7317e4 100644 --- a/routers/web/admin/repos.go +++ b/routers/web/admin/repos.go @@ -14,7 +14,6 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" - "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/web/explore" @@ -95,7 +94,7 @@ func UnadoptedRepos(ctx *context.Context) { } ctx.Data["Keyword"] = q - repoNames, count, err := repository.ListUnadoptedRepositories(q, &opts) + repoNames, count, err := repo_service.ListUnadoptedRepositories(q, &opts) if err != nil { ctx.ServerError("ListUnadoptedRepositories", err) } @@ -147,7 +146,7 @@ func AdoptOrDeleteRepository(ctx *context.Context) { if has || !isDir { // Fallthrough to failure mode } else if action == "adopt" { - if _, err := repository.AdoptRepository(ctx.User, ctxUser, models.CreateRepoOptions{ + if _, err := repo_service.AdoptRepository(ctx.User, ctxUser, models.CreateRepoOptions{ Name: dirSplit[1], IsPrivate: true, }); err != nil { @@ -156,7 +155,7 @@ func AdoptOrDeleteRepository(ctx *context.Context) { } ctx.Flash.Success(ctx.Tr("repo.adopt_preexisting_success", dir)) } else if action == "delete" { - if err := repository.DeleteUnadoptedRepository(ctx.User, ctxUser, dirSplit[1]); err != nil { + if err := repo_service.DeleteUnadoptedRepository(ctx.User, ctxUser, dirSplit[1]); err != nil { ctx.ServerError("repository.AdoptRepository", err) return } diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go index b104ede005..456084f086 100644 --- a/routers/web/repo/setting.go +++ b/routers/web/repo/setting.go @@ -557,7 +557,7 @@ func SettingsPost(ctx *context.Context) { return } - if err := repository.ConvertForkToNormalRepository(repo); err != nil { + if err := repo_service.ConvertForkToNormalRepository(repo); err != nil { log.Error("Unable to convert repository %-v from fork. Error: %v", repo, err) ctx.ServerError("Convert Fork", err) return diff --git a/routers/web/user/setting/adopt.go b/routers/web/user/setting/adopt.go index 2caccb69a5..948cc1e936 100644 --- a/routers/web/user/setting/adopt.go +++ b/routers/web/user/setting/adopt.go @@ -9,9 +9,9 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" - "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/util" + repo_service "code.gitea.io/gitea/services/repository" ) // AdoptOrDeleteRepository adopts or deletes a repository @@ -44,7 +44,7 @@ func AdoptOrDeleteRepository(ctx *context.Context) { if has || !isDir { // Fallthrough to failure mode } else if action == "adopt" && allowAdopt { - if _, err := repository.AdoptRepository(ctxUser, ctxUser, models.CreateRepoOptions{ + if _, err := repo_service.AdoptRepository(ctxUser, ctxUser, models.CreateRepoOptions{ Name: dir, IsPrivate: true, }); err != nil { @@ -53,7 +53,7 @@ func AdoptOrDeleteRepository(ctx *context.Context) { } ctx.Flash.Success(ctx.Tr("repo.adopt_preexisting_success", dir)) } else if action == "delete" && allowDelete { - if err := repository.DeleteUnadoptedRepository(ctxUser, ctxUser, dir); err != nil { + if err := repo_service.DeleteUnadoptedRepository(ctxUser, ctxUser, dir); err != nil { ctx.ServerError("repository.AdoptRepository", err) return } |