diff options
Diffstat (limited to 'routers/private')
-rw-r--r-- | routers/private/hook_post_receive.go | 4 | ||||
-rw-r--r-- | routers/private/hook_pre_receive.go | 2 | ||||
-rw-r--r-- | routers/private/key.go | 4 | ||||
-rw-r--r-- | routers/private/mail.go | 2 | ||||
-rw-r--r-- | routers/private/serv.go | 6 |
5 files changed, 9 insertions, 9 deletions
diff --git a/routers/private/hook_post_receive.go b/routers/private/hook_post_receive.go index 5e315ede47..eb2bbc1e5f 100644 --- a/routers/private/hook_post_receive.go +++ b/routers/private/hook_post_receive.go @@ -106,7 +106,7 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) { repo.IsPrivate = opts.GitPushOptions.Bool(private.GitPushOptionRepoPrivate, repo.IsPrivate) repo.IsTemplate = opts.GitPushOptions.Bool(private.GitPushOptionRepoTemplate, repo.IsTemplate) - if err := repo_model.UpdateRepositoryCols(repo, "is_private", "is_template"); err != nil { + if err := repo_model.UpdateRepositoryCols(ctx, repo, "is_private", "is_template"); err != nil { log.Error("Failed to Update: %s/%s Error: %v", ownerName, repoName, err) ctx.JSON(http.StatusInternalServerError, private.HookPostReceiveResult{ Err: fmt.Sprintf("Failed to Update: %s/%s Error: %v", ownerName, repoName, err), @@ -141,7 +141,7 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) { continue } - pr, err := models.GetPullRequestByIndex(repo.ID, pullIndex) + pr, err := models.GetPullRequestByIndex(ctx, repo.ID, pullIndex) if err != nil && !models.IsErrPullRequestNotExist(err) { log.Error("Failed to get PR by index %v Error: %v", pullIndex, err) ctx.JSON(http.StatusInternalServerError, private.Response{ diff --git a/routers/private/hook_pre_receive.go b/routers/private/hook_pre_receive.go index 9d3d665264..1f005d35bf 100644 --- a/routers/private/hook_pre_receive.go +++ b/routers/private/hook_pre_receive.go @@ -155,7 +155,7 @@ func preReceiveBranch(ctx *preReceiveContext, oldCommitID, newCommitID, refFullN return } - protectBranch, err := models.GetProtectedBranchBy(repo.ID, branchName) + protectBranch, err := models.GetProtectedBranchBy(ctx, repo.ID, branchName) if err != nil { log.Error("Unable to get protected branch: %s in %-v Error: %v", branchName, repo, err) ctx.JSON(http.StatusInternalServerError, private.Response{ diff --git a/routers/private/key.go b/routers/private/key.go index 3366b764e6..9977492c63 100644 --- a/routers/private/key.go +++ b/routers/private/key.go @@ -25,7 +25,7 @@ func UpdatePublicKeyInRepo(ctx *context.PrivateContext) { return } - deployKey, err := asymkey_model.GetDeployKeyByRepo(keyID, repoID) + deployKey, err := asymkey_model.GetDeployKeyByRepo(ctx, keyID, repoID) if err != nil { if asymkey_model.IsErrDeployKeyNotExist(err) { ctx.PlainText(http.StatusOK, "success") @@ -52,7 +52,7 @@ func UpdatePublicKeyInRepo(ctx *context.PrivateContext) { func AuthorizedPublicKeyByContent(ctx *context.PrivateContext) { content := ctx.FormString("content") - publicKey, err := asymkey_model.SearchPublicKeyByContent(content) + publicKey, err := asymkey_model.SearchPublicKeyByContent(ctx, content) if err != nil { ctx.JSON(http.StatusInternalServerError, private.Response{ Err: err.Error(), diff --git a/routers/private/mail.go b/routers/private/mail.go index 853b58b09d..966a838168 100644 --- a/routers/private/mail.go +++ b/routers/private/mail.go @@ -44,7 +44,7 @@ func SendEmail(ctx *context.PrivateContext) { var emails []string if len(mail.To) > 0 { for _, uname := range mail.To { - user, err := user_model.GetUserByName(uname) + user, err := user_model.GetUserByName(ctx, uname) if err != nil { err := fmt.Sprintf("Failed to get user information: %v", err) log.Error(err) diff --git a/routers/private/serv.go b/routers/private/serv.go index 77877e1ad8..803d51e9d9 100644 --- a/routers/private/serv.go +++ b/routers/private/serv.go @@ -109,7 +109,7 @@ func ServCommand(ctx *context.PrivateContext) { results.RepoName = repoName[:len(repoName)-5] } - owner, err := user_model.GetUserByName(results.OwnerName) + owner, err := user_model.GetUserByName(ctx, results.OwnerName) if err != nil { if user_model.IsErrUserNotExist(err) { // User is fetching/cloning a non-existent repository @@ -230,7 +230,7 @@ func ServCommand(ctx *context.PrivateContext) { var user *user_model.User if key.Type == asymkey_model.KeyTypeDeploy { var err error - deployKey, err = asymkey_model.GetDeployKeyByRepo(key.ID, repo.ID) + deployKey, err = asymkey_model.GetDeployKeyByRepo(ctx, key.ID, repo.ID) if err != nil { if asymkey_model.IsErrDeployKeyNotExist(err) { ctx.JSON(http.StatusNotFound, private.ErrServCommand{ @@ -345,7 +345,7 @@ func ServCommand(ctx *context.PrivateContext) { // We already know we aren't using a deploy key if !repoExist { - owner, err := user_model.GetUserByName(ownerName) + owner, err := user_model.GetUserByName(ctx, ownerName) if err != nil { ctx.JSON(http.StatusInternalServerError, private.ErrServCommand{ Results: results, |