summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-10-25 03:10:22 -0400
committerUnknwon <u@gogs.io>2015-10-25 03:10:22 -0400
commitc3ba5590c98a32c149c4dfa97bbfed65135d4f3e (patch)
tree8dd9ba8116d2616a1ce8c7db7b893ce702ed50ad /models/issue.go
parent379629d28ac5e4f7feb8ab6df8f0488d7dc5e69f (diff)
downloadgitea-c3ba5590c98a32c149c4dfa97bbfed65135d4f3e.tar.gz
gitea-c3ba5590c98a32c149c4dfa97bbfed65135d4f3e.zip
Reopen PR need retest patch
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/models/issue.go b/models/issue.go
index 1cefa42f5a..077e945c37 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -92,15 +92,6 @@ func (i *Issue) AfterSet(colName string, _ xorm.Cell) {
if err != nil {
log.Error(3, "GetUserByID[%d]: %v", i.ID, err)
}
- case "is_pull":
- if !i.IsPull {
- return
- }
-
- i.PullRequest, err = GetPullRequestByIssueID(i.ID)
- if err != nil {
- log.Error(3, "GetPullRequestByIssueID[%d]: %v", i.ID, err)
- }
case "created":
i.Created = regulateTimeZone(i.Created)
}
@@ -282,6 +273,15 @@ func (i *Issue) ChangeStatus(doer *User, isClosed bool) (err error) {
return sess.Commit()
}
+func (i *Issue) GetPullRequest() (err error) {
+ if i.PullRequest != nil {
+ return nil
+ }
+
+ i.PullRequest, err = GetPullRequestByIssueID(i.ID)
+ return err
+}
+
// It's caller's responsibility to create action.
func newIssue(e *xorm.Session, repo *Repository, issue *Issue, labelIDs []int64, uuids []string, isPull bool) (err error) {
if _, err = e.Insert(issue); err != nil {