[Backport] Fix comment broken issue ref dependence (#12651) (#12692)

* deleteIssuesByRepoID: delete related CommentTypeRemoveDependency & CommentTypeAddDependency comments too

* Ignore ErrIssueNotExist on comment.LoadDepIssueDetails()

* CI.restart()
This commit is contained in:
6543 authored and GitHub committed 2020-09-03 17:23:36 +08:00
1 parent 69e4b6910b
commit 0fa538e552
2 files changed
+9 -2

No files matched your search

+4 -2
View File
@@ -969,8 +969,10 @@ func ViewIssue(ctx *context.Context) {
}
} else if comment.Type == models.CommentTypeRemoveDependency || comment.Type == models.CommentTypeAddDependency {
if err = comment.LoadDepIssueDetails(); err != nil {
ctx.ServerError("LoadDepIssueDetails", err)
return
if !models.IsErrIssueNotExist(err) {
ctx.ServerError("LoadDepIssueDetails", err)
return
}
}
} else if comment.Type == models.CommentTypeCode || comment.Type == models.CommentTypeReview {
comment.RenderedContent = string(markdown.Render([]byte(comment.Content), ctx.Repo.RepoLink,