forked from NYANDEV/forgejo
* Fix dump and restore * return different error message for get commit * Fix missing delete release attachment when deleting repository * Fix ci and add some comments back port #16698 Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
parent
0274933c22
commit
af1fd56d8a
6 changed files with 17 additions and 4 deletions
|
@ -1490,6 +1490,11 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
|
|||
releaseAttachments = append(releaseAttachments, attachments[i].RelativePath())
|
||||
}
|
||||
|
||||
if _, err = sess.In("release_id", builder.Select("id").From("`release`").Where(builder.Eq{"`release`.repo_id": repoID})).
|
||||
Delete(&Attachment{}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := sess.Exec("UPDATE `user` SET num_stars=num_stars-1 WHERE id IN (SELECT `uid` FROM `star` WHERE repo_id = ?)", repo.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue