Browse Source

Delete dependencies when deleting a repository (#10608)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
mj
Lauris BH 3 years ago
committed by GitHub
parent
commit
6a57364dc8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      models/repo.go

12
models/repo.go

@ -1520,6 +1520,18 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
return err
}
// Dependencies for issues in this repository
if _, err = sess.In("issue_id", deleteCond).
Delete(&IssueDependency{}); err != nil {
return err
}
// Delete dependencies for issues in other repositories
if _, err = sess.In("dependency_id", deleteCond).
Delete(&IssueDependency{}); err != nil {
return err
}
if _, err = sess.In("issue_id", deleteCond).
Delete(&IssueUser{}); err != nil {
return err

Loading…
Cancel
Save