Skip to content

Commit aa91afb

Browse files
committed
fix test
Signed-off-by: a1012112796 <[email protected]>
1 parent 85b93b2 commit aa91afb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

models/issues/issue_project.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ func (issue *Issue) LoadProjectIssue(ctx context.Context) (err error) {
4242
return err
4343
}
4444

45+
issue.ProjectIssue.Project = issue.Project
46+
4547
return issue.ProjectIssue.LoadProjectColumn(ctx)
4648
}
4749

models/project/issue.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ import (
1414

1515
// ProjectIssue saves relation from issue to a project
1616
type ProjectIssue struct { //revive:disable-line:exported
17-
ID int64 `xorm:"pk autoincr"`
18-
IssueID int64 `xorm:"INDEX"`
19-
ProjectID int64 `xorm:"INDEX"`
17+
ID int64 `xorm:"pk autoincr"`
18+
IssueID int64 `xorm:"INDEX"`
19+
ProjectID int64 `xorm:"INDEX"`
20+
Project *Project `xorm:"-"`
2021

2122
// ProjectColumnID should not be zero since 1.22. If it's zero, the issue will not be displayed on UI and it might result in errors.
2223
ProjectColumnID int64 `xorm:"'project_board_id' INDEX"`
@@ -70,6 +71,11 @@ func (issue *ProjectIssue) LoadProjectColumn(ctx context.Context) error {
7071

7172
var err error
7273

74+
if issue.ProjectColumnID == 0 {
75+
issue.ProjectColumn, err = issue.Project.GetDefaultColumn(ctx)
76+
return err
77+
}
78+
7379
issue.ProjectColumn, err = GetColumn(ctx, issue.ProjectColumnID)
7480
return err
7581
}

0 commit comments

Comments
 (0)