1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

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>
This commit is contained in:
赵智超
2020-09-21 04:20:14 +08:00
committed by GitHub
parent e7ffc67ad5
commit fec1521555
10 changed files with 26 additions and 28 deletions

View File

@@ -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))