diff options
author | 赵智超 <1012112796@qq.com> | 2020-09-21 04:20:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 21:20:14 +0100 |
commit | fec152155543e72f2e03885d431642887ce09d69 (patch) | |
tree | 6ba0d440eec9df315c8acf487918036717cf98f0 /routers/api/v1/repo/fork.go | |
parent | e7ffc67ad5add193e90219a856935bf643b33fe1 (diff) | |
download | gitea-fec152155543e72f2e03885d431642887ce09d69.tar.gz gitea-fec152155543e72f2e03885d431642887ce09d69.zip |
Not using "ctx.ServerError" in api (#12907)
This function will render a whole html page which is not useful for API.
Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'routers/api/v1/repo/fork.go')
-rw-r--r-- | routers/api/v1/repo/fork.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo/fork.go b/routers/api/v1/repo/fork.go index 0dd961d7f0..e6f5f5e630 100644 --- a/routers/api/v1/repo/fork.go +++ b/routers/api/v1/repo/fork.go @@ -109,7 +109,7 @@ func CreateFork(ctx *context.APIContext, form api.CreateForkOption) { } isMember, err := org.IsOrgMember(ctx.User.ID) if err != nil { - ctx.ServerError("IsOrgMember", err) + ctx.Error(http.StatusInternalServerError, "IsOrgMember", err) return } else if !isMember { ctx.Error(http.StatusForbidden, "isMemberNot", fmt.Sprintf("User is no Member of Organisation '%s'", org.Name)) |