summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorDavid Schneiderbauer <daviian@users.noreply.github.com>2018-06-19 21:44:33 +0200
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-06-19 15:44:33 -0400
commita93f13849cd7f54029f1dc17b642d024b98ee71e (patch)
tree99340a1daec2fa3a3db14ed630b57c6bc3984fbe /models/repo.go
parent467ff4d34302f6ecab959d61bf3944a2bdf125d0 (diff)
downloadgitea-a93f13849cd7f54029f1dc17b642d024b98ee71e.tar.gz
gitea-a93f13849cd7f54029f1dc17b642d024b98ee71e.zip
Fix not removed watches on unallowed repositories (#4201)
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index f4923cf4a9..7f2be502a4 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1851,6 +1851,9 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
if _, err = sess.In("issue_id", issueIDs).Delete(&Reaction{}); err != nil {
return err
}
+ if _, err = sess.In("issue_id", issueIDs).Delete(&IssueWatch{}); err != nil {
+ return err
+ }
attachments := make([]*Attachment, 0, 5)
if err = sess.