Skip to content

Commit 4b70868

Browse files
committed
fix
1 parent 7c6197d commit 4b70868

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

services/web/server/src/simcore_service_webserver/projects/_projects_service.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,10 @@ async def add_project_states_for_user(
19911991
# upgrade the project
19921992
# NOTE: copy&dump step avoids both alias and field-names to be keys in the dict
19931993
# e.g. "current_status" and "currentStatus"
1994-
current_node_state = NodeState.model_validate(node.get("state", {}))
1994+
current_node_state = NodeState.model_validate(
1995+
node.get("state")
1996+
or {} # NOTE: that node.get("state") can exists and be None!
1997+
)
19951998
updated_node_state = current_node_state.model_copy(
19961999
update=computed_node_state.model_dump(mode="json", exclude_unset=True)
19972000
)

services/web/server/tests/unit/with_dbs/02/test_projects_nodes_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def inc_running_services(self, *args, **kwargs): # noqa: ARG002
483483
assert result
484484
node_ids = result.scalars().all()
485485
assert len(node_ids) == NUM_DY_SERVICES + num_services_in_project
486-
assert set(running_services.running_services_uuids).issubset(node_ids)
486+
assert {f"{i}" for i in running_services.running_services_uuids}.issubset(node_ids)
487487
print(f"--> {NUM_DY_SERVICES} nodes were created concurrently")
488488

489489
#

0 commit comments

Comments
 (0)