From fec152155543e72f2e03885d431642887ce09d69 Mon Sep 17 00:00:00 2001 From: 赵智超 <1012112796@qq.com> Date: Mon, 21 Sep 2020 04:20:14 +0800 Subject: 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> --- routers/api/v1/repo/fork.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/api/v1/repo/fork.go') 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)) -- cgit v1.2.3