aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-14 08:51:04 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-14 08:51:04 -0400
commit9100786beb0db4b3444d1be24e5a3bd680cdae1e (patch)
tree89b413a594e21aa7150755c820cf334ebb96b214 /models
parentb0084b1adcc5c446387f90a87100c1f97b4e71ec (diff)
downloadgitea-9100786beb0db4b3444d1be24e5a3bd680cdae1e.tar.gz
gitea-9100786beb0db4b3444d1be24e5a3bd680cdae1e.zip
Fix #185
Diffstat (limited to 'models')
-rw-r--r--models/repo.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index 6e27a0cc12..295b9af35f 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -676,6 +676,14 @@ func DeleteRepository(userId, repoId int64, userName string) (err error) {
sess.Rollback()
return err
}
+ if _, err = sess.Delete(&Issue{RepoId: repoId}); err != nil {
+ sess.Rollback()
+ return err
+ }
+ if _, err = sess.Delete(&IssueUser{RepoId: repoId}); err != nil {
+ sess.Rollback()
+ return err
+ }
rawSql := "UPDATE `user` SET num_repos = num_repos - 1 WHERE id = ?"
if _, err = sess.Exec(rawSql, userId); err != nil {