mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 09:55:20 +02: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:
parent
e7ffc67ad5
commit
fec1521555
10 changed files with 26 additions and 28 deletions
|
@ -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.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue