Fixed a bug where it was possible to add a team multiple times to a list/namespace

This commit is contained in:
kolaente 2018-07-24 17:46:32 +02:00 committed by konrad
parent 9638f36788
commit 26c2ad078f
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
5 changed files with 43 additions and 1 deletions

View file

@ -53,6 +53,10 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusBadRequest, "The team name cannot be empty.")
}
if models.IsErrTeamAlreadyHasAccess(err) {
return echo.NewHTTPError(http.StatusBadRequest, "This team already has access.")
}
return echo.NewHTTPError(http.StatusInternalServerError)
}