Browse Source

Small refactor for loading PRs (#22652)

tags/v1.19.0-rc0
Lunny Xiao 1 year ago
parent
commit
4e946e5a7d
No account linked to committer's email address
2 changed files with 3 additions and 3 deletions
  1. 3
    2
      models/issues/pull_list.go
  2. 0
    1
      services/pull/pull.go

+ 3
- 2
models/issues/pull_list.go View File

@@ -173,8 +173,9 @@ func (prs PullRequestList) loadAttributes(ctx context.Context) error {
for i := range issues {
set[issues[i].ID] = issues[i]
}
for i := range prs {
prs[i].Issue = set[prs[i].IssueID]
for _, pr := range prs {
pr.Issue = set[pr.IssueID]
pr.Issue.PullRequest = pr // panic here means issueIDs and prs are not in sync
}
return nil
}

+ 0
- 1
services/pull/pull.go View File

@@ -298,7 +298,6 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
}
}

pr.Issue.PullRequest = pr
notification.NotifyPullRequestSynchronized(ctx, doer, pr)
}
}

Loading…
Cancel
Save