summaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-09-04 03:36:56 +0200
committerGitHub <noreply@github.com>2020-09-04 09:36:56 +0800
commit6c5266c9cadf500ec8a166066bf4452801cc2545 (patch)
tree5f32a7e3a8438e07ea013f8a2db0069460795dc9 /routers/repo/issue.go
parent42a5e39b3bb17cf006a5d04887148a5ea9719f32 (diff)
downloadgitea-6c5266c9cadf500ec8a166066bf4452801cc2545.tar.gz
gitea-6c5266c9cadf500ec8a166066bf4452801cc2545.zip
[BugFix] Fix comment broken issue ref dependence (#12651)
* deleteIssuesByRepoID: delete related CommentTypeRemoveDependency & CommentTypeAddDependency comments too * Ignore ErrIssueNotExist on comment.LoadDepIssueDetails() * Add migration * Ignore 'dependent_issue_id = 0' case * exchange as per @lunny Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 4bbc355027..4c745ed5d7 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -1079,8 +1079,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,