aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/issue.go')
-rw-r--r--routers/web/repo/issue.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index ee4738c970..5af91c8e5f 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -20,6 +20,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/organization"
+ 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"
@@ -336,9 +337,9 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
}
if ctx.Repo.CanWriteIssuesOrPulls(ctx.Params(":type") == "pulls") {
- projects, _, err := models.GetProjects(models.ProjectSearchOptions{
+ projects, _, err := project_model.GetProjects(project_model.SearchOptions{
RepoID: repo.ID,
- Type: models.ProjectTypeRepository,
+ Type: project_model.TypeRepository,
IsClosed: util.OptionalBoolOf(isShowClosed),
})
if err != nil {
@@ -446,22 +447,22 @@ func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.R
func retrieveProjects(ctx *context.Context, repo *repo_model.Repository) {
var err error
- ctx.Data["OpenProjects"], _, err = models.GetProjects(models.ProjectSearchOptions{
+ ctx.Data["OpenProjects"], _, err = project_model.GetProjects(project_model.SearchOptions{
RepoID: repo.ID,
Page: -1,
IsClosed: util.OptionalBoolFalse,
- Type: models.ProjectTypeRepository,
+ Type: project_model.TypeRepository,
})
if err != nil {
ctx.ServerError("GetProjects", err)
return
}
- ctx.Data["ClosedProjects"], _, err = models.GetProjects(models.ProjectSearchOptions{
+ ctx.Data["ClosedProjects"], _, err = project_model.GetProjects(project_model.SearchOptions{
RepoID: repo.ID,
Page: -1,
IsClosed: util.OptionalBoolTrue,
- Type: models.ProjectTypeRepository,
+ Type: project_model.TypeRepository,
})
if err != nil {
ctx.ServerError("GetProjects", err)
@@ -814,7 +815,7 @@ func NewIssue(ctx *context.Context) {
projectID := ctx.FormInt64("project")
if projectID > 0 {
- project, err := models.GetProjectByID(projectID)
+ project, err := project_model.GetProjectByID(projectID)
if err != nil {
log.Error("GetProjectByID: %d: %v", projectID, err)
} else if project.RepoID != ctx.Repo.Repository.ID {
@@ -926,7 +927,7 @@ func ValidateRepoMetas(ctx *context.Context, form forms.CreateIssueForm, isPull
}
if form.ProjectID > 0 {
- p, err := models.GetProjectByID(form.ProjectID)
+ p, err := project_model.GetProjectByID(form.ProjectID)
if err != nil {
ctx.ServerError("GetProjectByID", err)
return nil, nil, 0, 0
@@ -1413,7 +1414,7 @@ func ViewIssue(ctx *context.Context) {
return
}
- ghostProject := &models.Project{
+ ghostProject := &project_model.Project{
ID: -1,
Title: ctx.Tr("repo.issues.deleted_project"),
}