Skip to content

Commit 09abdb8

Browse files
authored
Return 404 not 500 from API if team does not exist (go-gitea#13118) (go-gitea#13119)
Backport go-gitea#13118 If team does not exist expect ErrTeamNotExist not ErrUserNotEXist Fix go-gitea#11336 Signed-off-by: Andrew Thornton <[email protected]>
1 parent e0ae0b3 commit 09abdb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/api/v1/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ func orgAssignment(args ...bool) macaron.Handler {
397397
if assignTeam {
398398
ctx.Org.Team, err = models.GetTeamByID(ctx.ParamsInt64(":teamid"))
399399
if err != nil {
400-
if models.IsErrUserNotExist(err) {
400+
if models.IsErrTeamNotExist(err) {
401401
ctx.NotFound()
402402
} else {
403403
ctx.Error(http.StatusInternalServerError, "GetTeamById", err)

0 commit comments

Comments
 (0)