add ability to remove user and add task depndencies closes #69
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user