Browse Source

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 <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
tags/v1.13.0-rc1
zeripath GitHub 5 years ago
parent
commit
36b563df66
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      routers/api/v1/api.go

+ 1
- 1
routers/api/v1/api.go View File

@@ -404,7 +404,7 @@ func orgAssignment(args ...bool) macaron.Handler {
if assignTeam {
ctx.Org.Team, err = models.GetTeamByID(ctx.ParamsInt64(":teamid"))
if err != nil {
if models.IsErrUserNotExist(err) {
if models.IsErrTeamNotExist(err) {
ctx.NotFound()
} else {
ctx.Error(http.StatusInternalServerError, "GetTeamById", err)


Loading…
Cancel
Save