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:
@@ -373,7 +373,7 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
|
||||
if !ctx.User.IsAdmin {
|
||||
canCreate, err := org.CanCreateOrgRepo(ctx.User.ID)
|
||||
if err != nil {
|
||||
ctx.ServerError("CanCreateOrgRepo", err)
|
||||
ctx.Error(http.StatusInternalServerError, "CanCreateOrgRepo", err)
|
||||
return
|
||||
} else if !canCreate {
|
||||
ctx.Error(http.StatusForbidden, "", "Given user is not allowed to create repository in organization.")
|
||||
|
Reference in New Issue
Block a user