From 0fa538e552aa213f079a8a303496fe93ea24eb54 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 3 Sep 2020 11:23:36 +0200 Subject: [Backport] Fix comment broken issue ref dependence (#12651) (#12692) * deleteIssuesByRepoID: delete related CommentTypeRemoveDependency & CommentTypeAddDependency comments too * Ignore ErrIssueNotExist on comment.LoadDepIssueDetails() * CI.restart() --- models/issue.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'models') diff --git a/models/issue.go b/models/issue.go index 1a4de26b3a..05eed6a78d 100644 --- a/models/issue.go +++ b/models/issue.go @@ -1953,6 +1953,11 @@ func deleteIssuesByRepoID(sess Engine, repoID int64) (attachmentPaths []string, return } + if _, err = sess.In("dependent_issue_id", deleteCond). + Delete(&Comment{}); err != nil { + return + } + var attachments []*Attachment if err = sess.In("issue_id", deleteCond). Find(&attachments); err != nil { -- cgit v1.2.3