Skip to content

Commit 29ae51d

Browse files
committed
Follow yp05327's suggestion
1 parent 0a45d66 commit 29ae51d

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

models/issues/issue_list.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ func (issues IssueList) LoadAssignees(ctx context.Context) error {
312312

313313
for _, issue := range issues {
314314
issue.Assignees = assignees[issue.ID]
315+
if len(issue.Assignees) > 0 {
316+
issue.Assignee = issue.Assignees[0]
317+
}
315318
issue.isAssigneeLoaded = true
316319
}
317320
return nil

models/issues/pull_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func (prs PullRequestList) LoadRepositories(ctx context.Context) error {
174174
if err := db.GetEngine(ctx).
175175
In("id", repoIDs).
176176
Find(&reposMap); err != nil {
177-
return fmt.Errorf("find issues: %w", err)
177+
return fmt.Errorf("find repos: %w", err)
178178
}
179179
for _, pr := range prs {
180180
if pr.BaseRepo == nil {

routers/api/v1/repo/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func ListPullRequests(ctx *context.APIContext) {
118118
apiPrs := make([]*api.PullRequest, len(prs))
119119
// NOTE: load repository first, so that issue.Repo will be filled with pr.BaseRepo
120120
if err := prs.LoadRepositories(ctx); err != nil {
121-
ctx.Error(http.StatusInternalServerError, "LoadAttributes", err)
121+
ctx.Error(http.StatusInternalServerError, "LoadRepositories", err)
122122
return
123123
}
124124
issueList, err := prs.LoadIssues(ctx)

0 commit comments

Comments
 (0)