Skip to content

Commit c2f63e9

Browse files
fix
1 parent 0fb74d4 commit c2f63e9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

services/web/server/src/simcore_service_webserver/projects/_groups_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

services/web/server/src/simcore_service_webserver/projects/_groups_db.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from aiohttp import web
1111
from models_library.projects import ProjectID
1212
from models_library.users import GroupID
13-
from pydantic import BaseModel, TypeAdapter
13+
from pydantic import BaseModel, ConfigDict, TypeAdapter
1414
from simcore_postgres_database.models.project_to_groups import project_to_groups
1515
from simcore_postgres_database.utils_repos import transaction_context
1616
from 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

0 commit comments

Comments
 (0)