summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlinweijie2012 <395973991@qq.com>2018-09-13 22:58:01 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2018-09-13 22:58:01 +0800
commitf98040ad5007a3f1f8a80d2ec82f0333b4c684b7 (patch)
tree6d954ce8bb238ded017a9f66553993ea8380a9a5
parent126ba796dcc9ccdf9c25ed7d441786478be2825b (diff)
downloadgitea-f98040ad5007a3f1f8a80d2ec82f0333b4c684b7.tar.gz
gitea-f98040ad5007a3f1f8a80d2ec82f0333b4c684b7.zip
fix bug forget to remove Stopwatch when remove repository (#4928)
-rw-r--r--models/repo.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index 25f70bf1a1..c334431be7 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.