summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-09-03 11:23:36 +0200
committerGitHub <noreply@github.com>2020-09-03 17:23:36 +0800
commit0fa538e552aa213f079a8a303496fe93ea24eb54 (patch)
treefbd2ac539cd490d5f606cc7945d00f355e150588 /models
parent69e4b6910b024ec99521c1ca570ed4d232e11247 (diff)
downloadgitea-0fa538e552aa213f079a8a303496fe93ea24eb54.tar.gz
gitea-0fa538e552aa213f079a8a303496fe93ea24eb54.zip
[Backport] Fix comment broken issue ref dependence (#12651) (#12692)
* deleteIssuesByRepoID: delete related CommentTypeRemoveDependency & CommentTypeAddDependency comments too * Ignore ErrIssueNotExist on comment.LoadDepIssueDetails() * CI.restart()
Diffstat (limited to 'models')
-rw-r--r--models/issue.go5
1 files changed, 5 insertions, 0 deletions
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 {