summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-06-12 20:02:51 +0300
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-06-12 13:02:51 -0400
commit2b8c0bb5e2010d6691e80919f3e9ea65348162b1 (patch)
treee278b6ef6fa2c6ba6916614686826483543b2948 /models
parent406031d3ccbf844a400f8382c84c5bee3f46d98b (diff)
downloadgitea-2b8c0bb5e2010d6691e80919f3e9ea65348162b1.tar.gz
gitea-2b8c0bb5e2010d6691e80919f3e9ea65348162b1.zip
Delete reactions added to issues and comments when deleting repository (#4232)
Diffstat (limited to 'models')
-rw-r--r--models/repo.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index c95c867f37..f4923cf4a9 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1848,6 +1848,9 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
if _, err = sess.In("issue_id", issueIDs).Delete(&IssueUser{}); err != nil {
return err
}
+ if _, err = sess.In("issue_id", issueIDs).Delete(&Reaction{}); err != nil {
+ return err
+ }
attachments := make([]*Attachment, 0, 5)
if err = sess.