Return after error (#1875)

This allows you to work around the max timeout on the server.
This commit is contained in:
qwerty287 2023-06-19 17:46:48 +02:00 committed by GitHub
parent 0c3021473f
commit c3c1d3bcb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -166,6 +166,7 @@ func PatchRepo(c *gin.Context) {
if in.Timeout != nil && *in.Timeout > server.Config.Pipeline.MaxTimeout && !user.Admin {
c.String(http.StatusForbidden, fmt.Sprintf("Timeout is not allowed to be higher than max timeout (%dmin)", server.Config.Pipeline.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)