From 7fa3d494e27a5d16653bbbfdb5f4824e3d5f9a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Fri, 8 Nov 2024 16:11:09 +0100 Subject: [PATCH] Refactor user service to filter enabled pool members directly in query --- server/src/uds/core/managers/user_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/uds/core/managers/user_service.py b/server/src/uds/core/managers/user_service.py index 4715bcdea..a60bf2ec5 100644 --- a/server/src/uds/core/managers/user_service.py +++ b/server/src/uds/core/managers/user_service.py @@ -990,7 +990,7 @@ class UserServiceManager(metaclass=singleton.Singleton): # Get pool members. Just pools "visible" and "usable" poolMembers = [ - p for p in meta.members.all() if p.pool.isVisible() and p.pool.isUsable() and p.enabled + p for p in meta.members.filter(enabled=True) if p.pool.isVisible() and p.pool.isUsable() ] # Sort pools based on meta selection if meta.policy == MetaPool.PRIORITY_POOL: