mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 00:45:22 +02:00
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>
This commit is contained in:
parent
ea6efba9b3
commit
bd97736b9c
18 changed files with 810 additions and 713 deletions
|
@ -17,6 +17,7 @@ import (
|
|||
"code.gitea.io/gitea/models/db"
|
||||
"code.gitea.io/gitea/models/issues"
|
||||
"code.gitea.io/gitea/models/organization"
|
||||
project_model "code.gitea.io/gitea/models/project"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
|
@ -204,8 +205,8 @@ type Comment struct {
|
|||
RemovedLabels []*Label `xorm:"-"`
|
||||
OldProjectID int64
|
||||
ProjectID int64
|
||||
OldProject *Project `xorm:"-"`
|
||||
Project *Project `xorm:"-"`
|
||||
OldProject *project_model.Project `xorm:"-"`
|
||||
Project *project_model.Project `xorm:"-"`
|
||||
OldMilestoneID int64
|
||||
MilestoneID int64
|
||||
OldMilestone *Milestone `xorm:"-"`
|
||||
|
@ -469,7 +470,7 @@ func (c *Comment) LoadLabel() error {
|
|||
// LoadProject if comment.Type is CommentTypeProject, then load project.
|
||||
func (c *Comment) LoadProject() error {
|
||||
if c.OldProjectID > 0 {
|
||||
var oldProject Project
|
||||
var oldProject project_model.Project
|
||||
has, err := db.GetEngine(db.DefaultContext).ID(c.OldProjectID).Get(&oldProject)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -479,7 +480,7 @@ func (c *Comment) LoadProject() error {
|
|||
}
|
||||
|
||||
if c.ProjectID > 0 {
|
||||
var project Project
|
||||
var project project_model.Project
|
||||
has, err := db.GetEngine(db.DefaultContext).ID(c.ProjectID).Get(&project)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue