]> source.dussan.org Git - gitea.git/commitdiff
fix bug forget to remove Stopwatch when remove repository (#4928)
authorlinweijie2012 <395973991@qq.com>
Thu, 13 Sep 2018 14:58:01 +0000 (22:58 +0800)
committerLunny Xiao <xiaolunwen@gmail.com>
Thu, 13 Sep 2018 14:58:01 +0000 (22:58 +0800)
models/repo.go

index 25f70bf1a14933320a30a868ec0a01ee80fa25d8..c334431be78415b3fb3738e758a83101a31d37bc 100644 (file)
@@ -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.