From 8e5e661416c7cf90c29c1c0308226e143a30a5f9 Mon Sep 17 00:00:00 2001 From: ImMin5 Date: Tue, 23 Apr 2024 21:04:24 +0900 Subject: [PATCH] fix: update references field logic when create workspace by scheduler (#199) Signed-off-by: ImMin5 --- src/spaceone/identity/service/job_service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spaceone/identity/service/job_service.py b/src/spaceone/identity/service/job_service.py index ee47f035..076aac6a 100644 --- a/src/spaceone/identity/service/job_service.py +++ b/src/spaceone/identity/service/job_service.py @@ -505,7 +505,10 @@ def _create_workspace( if workspace_vo.name != name: params.update({"name": name}) - if workspace_vo.references and reference_id not in workspace_vo.references: + + if not workspace_vo.references: + params.update({"references": [reference_id]}) + elif reference_id not in workspace_vo.references: params.update({"references": workspace_vo.references + [reference_id]}) params.update({"last_synced_at": datetime.utcnow()})