From d74d16a4b1c79b5b1fc58998aa38bf299cee10ec Mon Sep 17 00:00:00 2001
From: Jason Song <i@wolfogre.com>
Date: Sun, 5 Feb 2023 22:24:43 +0800
Subject: [PATCH] Set PR for issue when load attributes for PRs (#22766)

A missing patch for #22650.
---
 models/issues/pull_list.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/models/issues/pull_list.go b/models/issues/pull_list.go
index 68f62ffc4..f4efd916c 100644
--- a/models/issues/pull_list.go
+++ b/models/issues/pull_list.go
@@ -187,6 +187,7 @@ func (prs PullRequestList) loadAttributes(ctx context.Context) error {
 		if pr.Issue == nil {
 			return fmt.Errorf("issues and prs may be not in sync: cannot find issue %v for pr %v: %w", pr.IssueID, pr.ID, util.ErrNotExist)
 		}
+		pr.Issue.PullRequest = pr
 	}
 	return nil
 }