Skip to content

Commit

Permalink
Improve issues.LoadProject (#22982)
Browse files Browse the repository at this point in the history
issues.LoadProject() is no use
change `issues.loadProject(ctx)` to issues.LoadProject(ctx)
  • Loading branch information
yp05327 authored Feb 20, 2023
1 parent cfc7a4e commit f4ce8c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion models/issues/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func (issue *Issue) LoadAttributes(ctx context.Context) (err error) {
return
}

if err = issue.loadProject(ctx); err != nil {
if err = issue.LoadProject(ctx); err != nil {
return
}

Expand Down
6 changes: 1 addition & 5 deletions models/issues/issue_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ import (
)

// LoadProject load the project the issue was assigned to
func (issue *Issue) LoadProject() (err error) {
return issue.loadProject(db.DefaultContext)
}

func (issue *Issue) loadProject(ctx context.Context) (err error) {
func (issue *Issue) LoadProject(ctx context.Context) (err error) {
if issue.Project == nil {
var p project_model.Project
if _, err = db.GetEngine(ctx).Table("project").
Expand Down

0 comments on commit f4ce8c7

Please sign in to comment.