aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-10-12 22:09:21 +0100
committerGitHub <noreply@github.com>2020-10-12 17:09:21 -0400
commitf2858600af811c584c82b45efbf343b53821575b (patch)
treee95ee8548b08821a5ba2d57c4cd4af65eed5bda3 /routers/api/v1
parent8be3e439c2b3a90fcb639b732008486b85314b8d (diff)
downloadgitea-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.go2
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)