aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-03-29 22:16:31 +0800
committerGitHub <noreply@github.com>2022-03-29 22:16:31 +0800
commitbd97736b9c7a16023bc9abf17be6157284f655b1 (patch)
treeeea5870d406bd00fa2e675901f24d9f1fbf1796f /models/repo.go
parentea6efba9b3fd298c842a935266060e405e2ae4a3 (diff)
downloadgitea-bd97736b9c7a16023bc9abf17be6157284f655b1.tar.gz
gitea-bd97736b9c7a16023bc9abf17be6157284f655b1.zip
Move project files into models/project sub package (#17704)
* Move project files into models/project sub package * Fix test * Fix test * Fix test * Fix build * Fix test * Fix template bug * Fix bug * Fix lint * Fix test * Fix import * Improve codes Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go
index 5a6a6b1a31..70539e849b 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -21,6 +21,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/organization"
"code.gitea.io/gitea/models/perm"
+ project_model "code.gitea.io/gitea/models/project"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unit"
user_model "code.gitea.io/gitea/models/user"
@@ -748,14 +749,14 @@ func DeleteRepository(doer *user_model.User, uid, repoID int64) error {
}
}
- projects, _, err := getProjects(sess, ProjectSearchOptions{
+ projects, _, err := project_model.GetProjectsCtx(ctx, project_model.SearchOptions{
RepoID: repoID,
})
if err != nil {
return fmt.Errorf("get projects: %v", err)
}
for i := range projects {
- if err := deleteProjectByID(sess, projects[i].ID); err != nil {
+ if err := project_model.DeleteProjectByIDCtx(ctx, projects[i].ID); err != nil {
return fmt.Errorf("delete project [%d]: %v", projects[i].ID, err)
}
}