Merge branch 'master' of https://cloud.o-forge.io/core/oc-lib
This commit is contained in:
		| @@ -36,7 +36,7 @@ func (wfa *workflowMongoAccessor) getExecutions(id string, data *Workflow) ([]*w | ||||
| 		} | ||||
| 		if len(data.Schedule.Cron) > 0 { | ||||
| 			if data.Schedule.End == nil { | ||||
| 				return workflows_execution, errors.New("a cron task should got a end date.") | ||||
| 				return workflows_execution, errors.New("a cron task should have an end date.") | ||||
| 			} | ||||
| 			cronStr := strings.Split(data.Schedule.Cron, " ") | ||||
| 			if len(cronStr) < 6 { | ||||
|   | ||||
| @@ -26,10 +26,6 @@ func (wfa *workspaceMongoAccessor) DeleteOne(id string) (utils.DBObject, int, er | ||||
| } | ||||
|  | ||||
| func (wfa *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) { | ||||
| 	res, _, err := wfa.Search(nil, set.GetName()) | ||||
| 	if err == nil && len(res) > 0 { | ||||
| 		return nil, 409, errors.New("A workspace with the same name already exists") | ||||
| 	} | ||||
| 	d := set.(*Workspace) | ||||
| 	d.DataResources = nil | ||||
| 	d.DatacenterResources = nil | ||||
| @@ -51,6 +47,10 @@ func (wfa *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (uti | ||||
| } | ||||
|  | ||||
| func (wfa *workspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) { | ||||
| 	res, _, err := wfa.Search(nil, data.GetName()) | ||||
| 	if err == nil && len(res) > 0 { | ||||
| 		return nil, 409, errors.New("A workspace with the same name already exists") | ||||
| 	} | ||||
| 	d := data.(*Workspace) | ||||
| 	d.DataResources = nil | ||||
| 	d.DatacenterResources = nil | ||||
|   | ||||
		Reference in New Issue
	
	Block a user