diff options
Diffstat (limited to 'services/convert')
-rw-r--r-- | services/convert/convert.go | 12 | ||||
-rw-r--r-- | services/convert/issue_comment.go | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/services/convert/convert.go b/services/convert/convert.go index 25c89747e3..cb246a8b4b 100644 --- a/services/convert/convert.go +++ b/services/convert/convert.go @@ -56,16 +56,16 @@ func ToBranch(ctx context.Context, repo *repo_model.Repository, branchName strin var canPush bool var err error if user != nil { - hasPerm, err = access_model.HasAccessUnit(db.DefaultContext, user, repo, unit.TypeCode, perm.AccessModeWrite) + hasPerm, err = access_model.HasAccessUnit(ctx, user, repo, unit.TypeCode, perm.AccessModeWrite) if err != nil { return nil, err } - perms, err := access_model.GetUserRepoPermission(db.DefaultContext, repo, user) + perms, err := access_model.GetUserRepoPermission(ctx, repo, user) if err != nil { return nil, err } - canPush = issues_model.CanMaintainerWriteToBranch(perms, branchName, user) + canPush = issues_model.CanMaintainerWriteToBranch(ctx, perms, branchName, user) } return &api.Branch{ @@ -94,13 +94,13 @@ func ToBranch(ctx context.Context, repo *repo_model.Repository, branchName strin } if user != nil { - permission, err := access_model.GetUserRepoPermission(db.DefaultContext, repo, user) + permission, err := access_model.GetUserRepoPermission(ctx, repo, user) if err != nil { return nil, err } bp.Repo = repo - branch.UserCanPush = bp.CanUserPush(db.DefaultContext, user) - branch.UserCanMerge = git_model.IsUserMergeWhitelisted(db.DefaultContext, bp, user.ID, permission) + branch.UserCanPush = bp.CanUserPush(ctx, user) + branch.UserCanMerge = git_model.IsUserMergeWhitelisted(ctx, bp, user.ID, permission) } return branch, nil diff --git a/services/convert/issue_comment.go b/services/convert/issue_comment.go index b0145c38e6..1308051e7c 100644 --- a/services/convert/issue_comment.go +++ b/services/convert/issue_comment.go @@ -114,7 +114,7 @@ func ToTimelineComment(ctx context.Context, repo *repo_model.Repository, c *issu } if c.Time != nil { - err = c.Time.LoadAttributes() + err = c.Time.LoadAttributes(ctx) if err != nil { log.Error("Time.LoadAttributes: %v", err) return nil |