From f98040ad5007a3f1f8a80d2ec82f0333b4c684b7 Mon Sep 17 00:00:00 2001 From: linweijie2012 <395973991@qq.com> Date: Thu, 13 Sep 2018 22:58:01 +0800 Subject: [PATCH] fix bug forget to remove Stopwatch when remove repository (#4928) --- models/repo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/repo.go b/models/repo.go index 25f70bf1a..c334431be 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1856,6 +1856,9 @@ func DeleteRepository(doer *User, uid, repoID int64) error { if _, err = sess.In("issue_id", issueIDs).Delete(&IssueWatch{}); err != nil { return err } + if _, err = sess.In("issue_id", issueIDs).Delete(&Stopwatch{}); err != nil { + return err + } attachments := make([]*Attachment, 0, 5) if err = sess.