File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
services/web/server/src/simcore_service_webserver/projects Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ async def list_project_groups_by_user_and_project(
8080 ] = await projects_groups_db .list_project_groups (app = app , project_id = project_id )
8181
8282 project_groups_api : list [ProjectGroupGet ] = [
83- ProjectGroupGet .model_validate (group .model_dump ()) for group in project_groups_db
83+ ProjectGroupGet .model_validate (group .model_dump ())
84+ for group in project_groups_db
8485 ]
8586
8687 return project_groups_api
Original file line number Diff line number Diff line change 1010from aiohttp import web
1111from models_library .projects import ProjectID
1212from models_library .users import GroupID
13- from pydantic import BaseModel , TypeAdapter
13+ from pydantic import BaseModel , ConfigDict , TypeAdapter
1414from simcore_postgres_database .models .project_to_groups import project_to_groups
1515from simcore_postgres_database .utils_repos import transaction_context
1616from sqlalchemy import func , literal_column
@@ -34,6 +34,8 @@ class ProjectGroupGetDB(BaseModel):
3434 created : datetime
3535 modified : datetime
3636
37+ model_config = ConfigDict (from_attributes = True )
38+
3739
3840## DB API
3941
@@ -89,7 +91,7 @@ async def list_project_groups(
8991
9092 async with transaction_context (get_asyncpg_engine (app ), connection ) as conn :
9193 result = await conn .stream (stmt )
92- rows = await result .first () or []
94+ rows = await result .all () or []
9395 return TypeAdapter (list [ProjectGroupGetDB ]).validate_python (rows )
9496
9597
You can’t perform that action at this time.
0 commit comments