diff options
Diffstat (limited to 'models/repo_transfer.go')
-rw-r--r-- | models/repo_transfer.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/models/repo_transfer.go b/models/repo_transfer.go index b283bc8c74..79cfc699c8 100644 --- a/models/repo_transfer.go +++ b/models/repo_transfer.go @@ -51,7 +51,7 @@ func (r *RepoTransfer) LoadAttributes() error { if r.Recipient.IsOrganization() && len(r.TeamIDs) != len(r.Teams) { for _, v := range r.TeamIDs { - team, err := organization.GetTeamByID(v) + team, err := organization.GetTeamByID(db.DefaultContext, v) if err != nil { return err } @@ -130,7 +130,7 @@ func CancelRepositoryTransfer(repo *repo_model.Repository) error { defer committer.Close() repo.Status = repo_model.RepositoryReady - if err := repo_model.UpdateRepositoryColsCtx(ctx, repo, "status"); err != nil { + if err := repo_model.UpdateRepositoryCols(ctx, repo, "status"); err != nil { return err } @@ -172,12 +172,12 @@ func CreatePendingRepositoryTransfer(doer, newOwner *user_model.User, repoID int } repo.Status = repo_model.RepositoryPendingTransfer - if err := repo_model.UpdateRepositoryColsCtx(ctx, repo, "status"); err != nil { + if err := repo_model.UpdateRepositoryCols(ctx, repo, "status"); err != nil { return err } // Check if new owner has repository with same name. - if has, err := repo_model.IsRepositoryExistCtx(ctx, newOwner, repo.Name); err != nil { + if has, err := repo_model.IsRepositoryExist(ctx, newOwner, repo.Name); err != nil { return fmt.Errorf("IsRepositoryExist: %v", err) } else if has { return repo_model.ErrRepoAlreadyExist{ @@ -250,14 +250,14 @@ func TransferOwnership(doer *user_model.User, newOwnerName string, repo *repo_mo sess := db.GetEngine(ctx) - newOwner, err := user_model.GetUserByNameCtx(ctx, newOwnerName) + newOwner, err := user_model.GetUserByName(ctx, newOwnerName) if err != nil { return fmt.Errorf("get new owner '%s': %v", newOwnerName, err) } newOwnerName = newOwner.Name // ensure capitalisation matches // Check if new owner has repository with same name. - if has, err := repo_model.IsRepositoryExistCtx(ctx, newOwner, repo.Name); err != nil { + if has, err := repo_model.IsRepositoryExist(ctx, newOwner, repo.Name); err != nil { return fmt.Errorf("IsRepositoryExist: %v", err) } else if has { return repo_model.ErrRepoAlreadyExist{ @@ -343,13 +343,13 @@ func TransferOwnership(doer *user_model.User, newOwnerName string, repo *repo_mo return fmt.Errorf("decrease old owner repository count: %v", err) } - if err := repo_model.WatchRepoCtx(ctx, doer.ID, repo.ID, true); err != nil { + if err := repo_model.WatchRepo(ctx, doer.ID, repo.ID, true); err != nil { return fmt.Errorf("watchRepo: %v", err) } // Remove watch for organization. if oldOwner.IsOrganization() { - if err := repo_model.WatchRepoCtx(ctx, oldOwner.ID, repo.ID, false); err != nil { + if err := repo_model.WatchRepo(ctx, oldOwner.ID, repo.ID, false); err != nil { return fmt.Errorf("watchRepo [false]: %v", err) } } @@ -410,7 +410,7 @@ func TransferOwnership(doer *user_model.User, newOwnerName string, repo *repo_mo return fmt.Errorf("deleteRepositoryTransfer: %v", err) } repo.Status = repo_model.RepositoryReady - if err := repo_model.UpdateRepositoryColsCtx(ctx, repo, "status"); err != nil { + if err := repo_model.UpdateRepositoryCols(ctx, repo, "status"); err != nil { return err } |