Return after error (#1875) (#1876)

Backport #1875
This commit is contained in:
qwerty287
2023-06-19 17:52:21 +02:00
committed by GitHub
parent b02354658b
commit fc7aacb663

View File

@@ -118,6 +118,7 @@ func PatchRepo(c *gin.Context) {
if in.Timeout != nil && *in.Timeout > maxTimeout && !user.Admin {
c.String(http.StatusForbidden, fmt.Sprintf("Timeout is not allowed to be higher than max timeout (%dmin)", maxTimeout))
return
}
if in.IsTrusted != nil && *in.IsTrusted != repo.IsTrusted && !user.Admin {
log.Trace().Msgf("user '%s' wants to make repo trusted without being an instance admin ", user.Login)