diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-14 08:51:04 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-14 08:51:04 -0400 |
commit | 9100786beb0db4b3444d1be24e5a3bd680cdae1e (patch) | |
tree | 89b413a594e21aa7150755c820cf334ebb96b214 /models | |
parent | b0084b1adcc5c446387f90a87100c1f97b4e71ec (diff) | |
download | gitea-9100786beb0db4b3444d1be24e5a3bd680cdae1e.tar.gz gitea-9100786beb0db4b3444d1be24e5a3bd680cdae1e.zip |
Fix #185
Diffstat (limited to 'models')
-rw-r--r-- | models/repo.go | 8 |
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 { |