From 1e513074663160b46218a271e55de8b63cdb3734 Mon Sep 17 00:00:00 2001 From: linweijie2012 <395973991@qq.com> Date: Fri, 14 Sep 2018 16:09:25 +0800 Subject: [PATCH] fix bug forget to remove Stopwatch when remove repository (#4933) fix bug forget to remove Stopwatch when remove repository --- models/repo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/repo.go b/models/repo.go index 5fdc248de..ca592a8d0 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1852,6 +1852,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.