add ability to remove user and add task depndencies closes #69

This commit is contained in:
2024-04-17 14:56:57 +01:00
parent 00ddb91a22
commit 8ece8306dd
25 changed files with 439 additions and 54 deletions

View File

@@ -439,6 +439,8 @@ func handleDataUpload(handle *Handle) {
return c.SendJSONStatus(http.StatusNotFound, "Model not found")
} else if err != nil {
return c.Error500(err)
} else if model.CanTrain == 0 {
return c.JsonBadRequest("Model can not be trained!")
}
// TODO mk this path configurable
@@ -468,6 +470,10 @@ func handleDataUpload(handle *Handle) {
model, err := GetBaseModel(c.Db, obj.Id)
if err == ModelNotFoundError {
return c.JsonBadRequest("Model not found")
} else if err != nil {
return c.E500M("Failed to get model information", err)
} else if model.CanTrain == 0 {
return c.JsonBadRequest("Model can not be trained!")
}
if model.ModelType != 2 && model.Status != CONFIRM_PRE_TRAINING || model.ModelType == 2 && model.Status != CONFIRM_PRE_TRAINING && model.Status != READY {
@@ -516,6 +522,8 @@ func handleDataUpload(handle *Handle) {
return c.JsonBadRequest("Could not find the model")
} else if err != nil {
return c.E500M("Error getting model information", err)
} else if model.CanTrain == 0 {
return c.JsonBadRequest("Model can not be trained!")
}
// TODO make this work for zip files as well
@@ -622,6 +630,8 @@ func handleDataUpload(handle *Handle) {
return c.SendJSONStatus(http.StatusNotFound, "Model not found")
} else if err != nil {
return c.Error500(err)
} else if model.CanTrain == 0 {
return c.JsonBadRequest("Model can not be trained!")
}
// TODO work in allowing the model to add new in the pre ready moment