From 0f9f163073d97f3ae9b103037b6f56790a626c29 Mon Sep 17 00:00:00 2001 From: Andrea Cordoba Date: Tue, 3 Dec 2024 11:46:42 +0100 Subject: [PATCH] fix: include direct member flag in total group query --- components/renku_data_services/namespace/db.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/renku_data_services/namespace/db.py b/components/renku_data_services/namespace/db.py index 154adea31..3e386aa80 100644 --- a/components/renku_data_services/namespace/db.py +++ b/components/renku_data_services/namespace/db.py @@ -90,6 +90,8 @@ async def get_groups( groups_orm = result.scalars().all() stmt_count = select(func.count()).select_from(schemas.GroupORM) + if direct_member: + stmt_count = stmt_count.where(schemas.GroupORM.id.in_(group_ids)) result = await session.execute(stmt_count) n_total_elements = result.scalar() or 0 return [g.dump() for g in groups_orm], n_total_elements