@@ -117,25 +117,26 @@ async def _add_frontend_needed_data(
117117 # with information from the projects table!
118118 # NOTE: This part with the projects, should be done in the client code not here!
119119
120- prj_names_mapping : dict [ ProjectID | NodeID , str ] = {}
121-
122- async for proj_data in ProjectRepository . instance ( engine ). list_valid_projects_in (
123- include_uuids = project_ids
124- ):
125- prj_names_mapping |= { proj_data . uuid : proj_data . name } | {
126- NodeID ( node_id ): node_data . label
127- for node_id , node_data in proj_data . workbench . items ()
128- }
120+ repo = ProjectRepository . instance ( engine )
121+ valid_project_uuids = [
122+ proj_data . uuid
123+ async for proj_data in repo . list_valid_projects_in ( project_uuids = project_ids )
124+ ]
125+
126+ prj_names_mapping = await repo . get_project_id_and_node_id_to_names_map (
127+ project_uuids = valid_project_uuids
128+ )
129129
130130 clean_data : list [FileMetaData ] = []
131131 for d in data :
132132 if d .project_id not in prj_names_mapping :
133133 continue
134134 assert d .project_id # nosec
135- d .project_name = prj_names_mapping [d .project_id ]
136- if d .node_id in prj_names_mapping :
135+ names_mapping = prj_names_mapping [d .project_id ]
136+ d .project_name = names_mapping [f"{ d .project_id } " ]
137+ if d .node_id in names_mapping :
137138 assert d .node_id # nosec
138- d .node_name = prj_names_mapping [ d .node_id ]
139+ d .node_name = names_mapping [ f" { d .node_id } " ]
139140 if d .node_name and d .project_name :
140141 clean_data .append (d )
141142
@@ -170,7 +171,7 @@ async def list_datasets(self, user_id: UserID) -> list[DatasetMetaData]:
170171 )
171172 async for prj_data in ProjectRepository .instance (
172173 get_db_engine (self .app )
173- ).list_valid_projects_in (include_uuids = readable_projects_ids )
174+ ).list_valid_projects_in (project_uuids = readable_projects_ids )
174175 ]
175176
176177 async def list_files_in_dataset (
@@ -782,8 +783,8 @@ async def deep_copy_project_simcore_s3(
782783 node_mapping : dict [NodeID , NodeID ],
783784 task_progress : ProgressBarData ,
784785 ) -> None :
785- src_project_uuid : ProjectID = ProjectID (src_project ["uuid" ])
786- dst_project_uuid : ProjectID = ProjectID (dst_project ["uuid" ])
786+ src_project_uuid = ProjectID (src_project ["uuid" ])
787+ dst_project_uuid = ProjectID (dst_project ["uuid" ])
787788 with log_context (
788789 _logger ,
789790 logging .INFO ,
0 commit comments