diff options
author | zeripath <art27@cantab.net> | 2020-10-12 22:09:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 17:09:21 -0400 |
commit | f2858600af811c584c82b45efbf343b53821575b (patch) | |
tree | e95ee8548b08821a5ba2d57c4cd4af65eed5bda3 /routers/api/v1 | |
parent | 8be3e439c2b3a90fcb639b732008486b85314b8d (diff) | |
download | gitea-f2858600af811c584c82b45efbf343b53821575b.tar.gz gitea-f2858600af811c584c82b45efbf343b53821575b.zip |
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>
Diffstat (limited to 'routers/api/v1')
-rw-r--r-- | routers/api/v1/api.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 7b2d567e3a..acd97648bf 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -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) |