Skip to content

Commit 1ceff4d

Browse files
fix: temp include workbench on a validation
1 parent d9881a1 commit 1ceff4d

File tree

2 files changed

+2
-13
lines changed
  • packages/models-library/src/models_library
  • services/storage/src/simcore_service_storage/modules/db

2 files changed

+2
-13
lines changed

packages/models-library/src/models_library/projects.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,6 @@ class BaseProjectModel(BaseModel):
111111
# NOTE: GCR: a validation failed (See: services/storage/src/simcore_service_storage/modules/db/projects.py)
112112
workbench: Annotated[NodesDict, Field(description="Project's pipeline")]
113113

114-
@classmethod
115-
def model_validate_ignoring_workbench(cls, obj: Any):
116-
if isinstance(obj, dict):
117-
data = dict(obj)
118-
data.pop("workbench", None)
119-
else:
120-
data = obj
121-
model = cls.model_validate(data)
122-
if isinstance(obj, dict) and "workbench" in obj:
123-
model.workbench = obj["workbench"]
124-
return model
125-
126114

127115
class ProjectAtDB(BaseProjectModel):
128116
# Model used to READ from database

services/storage/src/simcore_service_storage/modules/db/projects.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ async def list_valid_projects_in(
3131
)
3232
):
3333
with suppress(ValidationError):
34-
yield ProjectAtDB.model_validate_ignoring_workbench(row._asdict())
34+
# FIXME: remove workbench once model is fixed
35+
yield ProjectAtDB.model_validate(row._asdict() | {"workbench": {}})
3536

3637
async def get_project_id_and_node_id_to_names_map(
3738
self,

0 commit comments

Comments
 (0)