diff --git a/services/web/server/src/simcore_service_webserver/projects/_db_utils.py b/services/web/server/src/simcore_service_webserver/projects/_db_utils.py index 35be5c4056c..598d6ff86c9 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_db_utils.py +++ b/services/web/server/src/simcore_service_webserver/projects/_db_utils.py @@ -9,7 +9,7 @@ import sqlalchemy as sa from aiopg.sa.connection import SAConnection from aiopg.sa.result import RowProxy -from models_library.projects import ProjectAtDB +from models_library.projects import ProjectAtDB, ProjectID from models_library.projects_nodes import Node from models_library.projects_nodes_io import NodeIDStr from models_library.users import UserID @@ -164,7 +164,10 @@ async def _get_tags_by_project(conn: SAConnection, project_id: str) -> list: @staticmethod async def _upsert_tags_in_project( - conn: SAConnection, project_index_id: int, project_tags: list[int] + conn: SAConnection, + project_index_id: int, + project_uuid: ProjectID, + project_tags: list[int], ) -> None: for tag_id in project_tags: await conn.execute( @@ -172,6 +175,7 @@ async def _upsert_tags_in_project( .values( project_id=project_index_id, tag_id=tag_id, + project_uuid_for_rut=project_uuid, ) .on_conflict_do_nothing() ) diff --git a/services/web/server/src/simcore_service_webserver/projects/db.py b/services/web/server/src/simcore_service_webserver/projects/db.py index 5554bee1d18..5413c4e824f 100644 --- a/services/web/server/src/simcore_service_webserver/projects/db.py +++ b/services/web/server/src/simcore_service_webserver/projects/db.py @@ -202,6 +202,7 @@ def _reraise_if_not_unique_uuid_error(err: UniqueViolation): await self._upsert_tags_in_project( conn=conn, project_index_id=project_index, + project_uuid=project_uuid, project_tags=project_tag_ids, ) selected_values["tags"] = project_tag_ids