From 8cba10c4fe29eb700a0afe4c1fa7f30ccae57ac1 Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 23 Jan 2025 09:27:27 +0100 Subject: [PATCH] light modification --- models/collaborative_area/collaborative_area_mongo_accessor.go | 3 ++- models/workflow_execution/workflow_execution.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/models/collaborative_area/collaborative_area_mongo_accessor.go b/models/collaborative_area/collaborative_area_mongo_accessor.go index 1564d0a..27301b1 100644 --- a/models/collaborative_area/collaborative_area_mongo_accessor.go +++ b/models/collaborative_area/collaborative_area_mongo_accessor.go @@ -68,7 +68,8 @@ func (a *collaborativeAreaMongoAccessor) StoreOne(data utils.DBObject) (utils.DB data.(*CollaborativeArea).Clear(id) // set the creator // retrieve or proper peer dd, code, err := a.peerAccessor.Search(nil, "0", true) - if code != 200 || len(dd) == 0 { + + if code != 200 || dd == nil || len(dd) == 0 { return nil, code, errors.New("Could not retrieve the peer" + err.Error()) } data.(*CollaborativeArea).CollaborativeAreaRule.Creator = dd[0].GetID() diff --git a/models/workflow_execution/workflow_execution.go b/models/workflow_execution/workflow_execution.go index 74efdee..d21d756 100644 --- a/models/workflow_execution/workflow_execution.go +++ b/models/workflow_execution/workflow_execution.go @@ -28,7 +28,8 @@ type WorkflowExecutions struct { } func (r *WorkflowExecutions) StoreDraftDefault() { - r.IsDraft = true + // r.IsDraft = true + r.IsDraft = false // TODO: TEMPORARY } func (r *WorkflowExecutions) CanUpdate(set utils.DBObject) (bool, utils.DBObject) {