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 6d72ffc74ed..7890537a984 100644 --- a/services/web/server/src/simcore_service_webserver/projects/db.py +++ b/services/web/server/src/simcore_service_webserver/projects/db.py @@ -529,13 +529,7 @@ async def list_projects( # pylint: disable=too-many-arguments,too-many-statemen None ) # <-- All shared workspaces ) - if filter_by_text is not None: - shared_workspace_query = shared_workspace_query.join( - users, users.c.id == projects.c.prj_owner, isouter=True - ) - else: - # FIXME: PC: Aks Matus why test_trash_project_in_subfolder fails here! assert ( # nosec workspace_query.workspace_scope == WorkspaceScope.SHARED ) @@ -544,6 +538,12 @@ async def list_projects( # pylint: disable=too-many-arguments,too-many-statemen == workspace_query.workspace_id # <-- Specific shared workspace ) + if filter_by_text is not None: + # NOTE: fields searched with text include user's email + shared_workspace_query = shared_workspace_query.join( + users, users.c.id == projects.c.prj_owner, isouter=True + ) + else: shared_workspace_query = None diff --git a/services/web/server/tests/unit/with_dbs/03/test_trash.py b/services/web/server/tests/unit/with_dbs/03/test_trash.py index e2b4e3ab06d..9080eb74fd8 100644 --- a/services/web/server/tests/unit/with_dbs/03/test_trash.py +++ b/services/web/server/tests/unit/with_dbs/03/test_trash.py @@ -665,7 +665,7 @@ async def test_trash_project_in_subfolder( ) data, _ = await assert_status(resp, status.HTTP_200_OK) assert len(data) == 1 - assert data[0]["uuid"] == project_uuid + assert data[0]["uuid"] == f"{project_uuid}" # UNTRASH resp = await client.post(f"/v0/projects/{project_uuid}:untrash")