Skip to content

Commit f285860

Browse files
zeripathlafriks
andauthored
Return 404 not 500 from API if team does not exist (#13118)
If team does not exist expect ErrTeamNotExist not ErrUserNotEXist Fix #11336 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: Lauris BH <[email protected]>
1 parent 8be3e43 commit f285860

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
@@ -404,7 +404,7 @@ func orgAssignment(args ...bool) macaron.Handler {
404404
if assignTeam {
405405
ctx.Org.Team, err = models.GetTeamByID(ctx.ParamsInt64(":teamid"))
406406
if err != nil {
407-
if models.IsErrUserNotExist(err) {
407+
if models.IsErrTeamNotExist(err) {
408408
ctx.NotFound()
409409
} else {
410410
ctx.Error(http.StatusInternalServerError, "GetTeamById", err)

0 commit comments

Comments
 (0)