1
0
Fork 0
forked from forgejo/forgejo

move repository deletion to service layer (#26948)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao 2023-09-08 12:51:15 +08:00 committed by GitHub
parent 3c0c279658
commit 4f32abaf94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 567 additions and 476 deletions

View file

@ -17,7 +17,7 @@ import (
func TeamAddRepository(t *organization.Team, repo *repo_model.Repository) (err error) {
if repo.OwnerID != t.OrgID {
return errors.New("repository does not belong to organization")
} else if models.HasRepository(t, repo.ID) {
} else if organization.HasTeamRepo(db.DefaultContext, t.OrgID, t.ID, repo.ID) {
return nil
}