feat: create none inventory by default

This commit is contained in:
fiftin 2024-03-10 23:06:17 +01:00
parent 4c8312bc9b
commit 4a5ca60c70

View File

@ -1,10 +1,10 @@
package projects
import (
log "github.com/sirupsen/logrus"
"github.com/ansible-semaphore/semaphore/api/helpers"
"github.com/ansible-semaphore/semaphore/db"
"github.com/ansible-semaphore/semaphore/util"
log "github.com/sirupsen/logrus"
"net/http"
"github.com/gorilla/context"
@ -223,6 +223,17 @@ func AddProject(w http.ResponseWriter, r *http.Request) {
return
}
_, err = store.CreateInventory(db.Inventory{
Name: "None",
ProjectID: body.ID,
Type: "none",
})
if err != nil {
helpers.WriteError(w, err)
return
}
if bodyWithDemo.Demo {
err = createDemoProject(body.ID, store)