diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-03-22 08:03:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-22 15:03:22 +0800 |
commit | 80fd25524e13dedbdc3527b32d008de152213a89 (patch) | |
tree | 63b2bfe4ffaf1dce12080cabdc2e845c8731a673 /routers/api/v1/repo/fork.go | |
parent | 5495ba7660979973ba19e304786135da474e0e64 (diff) | |
download | gitea-80fd25524e13dedbdc3527b32d008de152213a89.tar.gz gitea-80fd25524e13dedbdc3527b32d008de152213a89.zip |
Renamed ctx.User to ctx.Doer. (#19161)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/api/v1/repo/fork.go')
-rw-r--r-- | routers/api/v1/repo/fork.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/fork.go b/routers/api/v1/repo/fork.go index d814ae909e..6cf51b2467 100644 --- a/routers/api/v1/repo/fork.go +++ b/routers/api/v1/repo/fork.go @@ -58,7 +58,7 @@ func ListForks(ctx *context.APIContext) { } apiForks := make([]*api.Repository, len(forks)) for i, fork := range forks { - access, err := models.AccessLevel(ctx.User, fork) + access, err := models.AccessLevel(ctx.Doer, fork) if err != nil { ctx.Error(http.StatusInternalServerError, "AccessLevel", err) return @@ -106,7 +106,7 @@ func CreateFork(ctx *context.APIContext) { repo := ctx.Repo.Repository var forker *user_model.User // user/org that will own the fork if form.Organization == nil { - forker = ctx.User + forker = ctx.Doer } else { org, err := models.GetOrgByName(*form.Organization) if err != nil { @@ -117,7 +117,7 @@ func CreateFork(ctx *context.APIContext) { } return } - isMember, err := org.IsOrgMember(ctx.User.ID) + isMember, err := org.IsOrgMember(ctx.Doer.ID) if err != nil { ctx.Error(http.StatusInternalServerError, "IsOrgMember", err) return @@ -135,7 +135,7 @@ func CreateFork(ctx *context.APIContext) { name = *form.Name } - fork, err := repo_service.ForkRepository(ctx.User, forker, repo_service.ForkRepoOptions{ + fork, err := repo_service.ForkRepository(ctx.Doer, forker, repo_service.ForkRepoOptions{ BaseRepo: repo, Name: name, Description: repo.Description, |