diff --git a/modules/activitypub/comment.go b/modules/activitypub/comment.go index 97985f65b..b5ea35034 100644 --- a/modules/activitypub/comment.go +++ b/modules/activitypub/comment.go @@ -27,7 +27,7 @@ func Comment(ctx context.Context, note *ap.Note) error { contextSplit := strings.Split(context.String(), "/") username := contextSplit[3] reponame := contextSplit[4] - repo, _ := repo_model.GetRepositoryByOwnerAndName(username, reponame) + repo, _ := repo_model.GetRepositoryByOwnerAndNameCtx(ctx, username, reponame) idx, _ := strconv.ParseInt(contextSplit[len(contextSplit)-1], 10, 64) issue, _ := issues.GetIssueByIndex(repo.ID, idx) diff --git a/routers/api/v1/activitypub/ticket.go b/routers/api/v1/activitypub/ticket.go index ce38ffe38..dd033f27a 100644 --- a/routers/api/v1/activitypub/ticket.go +++ b/routers/api/v1/activitypub/ticket.go @@ -50,17 +50,17 @@ func Ticket(ctx *context.APIContext) { repo, err := repo_model.GetRepositoryByOwnerAndNameCtx(ctx, ctx.ContextUser.Name, ctx.Repo.Repository.Name) if err != nil { - ctx.ServerError("Couldn't get repo", err) + ctx.ServerError("GetRepositoryByOwnerAndNameCtx", err) return } index, err := strconv.ParseInt(ctx.Params("id"), 10, 64) if err != nil { - ctx.ServerError("ID must be an integer", err) + ctx.ServerError("ParseInt", err) return } issue, err := issues_model.GetIssueByIndex(repo.ID, index) if err != nil { - ctx.ServerError("Couldn't get issue", err) + ctx.ServerError("GetIssueByIndex", err) return }