Next round of db.DefaultContext refactor (#27089)

Part of #27065
This commit is contained in:
JakobDev 2023-09-16 16:39:12 +02:00 committed by GitHub
parent a1b2a11812
commit f91dbbba98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 434 additions and 464 deletions

View file

@ -799,7 +799,7 @@ func SettingsPost(ctx *context.Context) {
return
}
if err := models.CancelRepositoryTransfer(ctx.Repo.Repository); err != nil {
if err := models.CancelRepositoryTransfer(ctx, ctx.Repo.Repository); err != nil {
ctx.ServerError("CancelRepositoryTransfer", err)
return
}
@ -863,7 +863,7 @@ func SettingsPost(ctx *context.Context) {
return
}
if err := repo_model.SetArchiveRepoState(repo, true); err != nil {
if err := repo_model.SetArchiveRepoState(ctx, repo, true); err != nil {
log.Error("Tried to archive a repo: %s", err)
ctx.Flash.Error(ctx.Tr("repo.settings.archive.error"))
ctx.Redirect(ctx.Repo.RepoLink + "/settings")
@ -881,7 +881,7 @@ func SettingsPost(ctx *context.Context) {
return
}
if err := repo_model.SetArchiveRepoState(repo, false); err != nil {
if err := repo_model.SetArchiveRepoState(ctx, repo, false); err != nil {
log.Error("Tried to unarchive a repo: %s", err)
ctx.Flash.Error(ctx.Tr("repo.settings.unarchive.error"))
ctx.Redirect(ctx.Repo.RepoLink + "/settings")