diff --git a/data/model.py b/data/model.py index 3414c4a08..9182950be 100644 --- a/data/model.py +++ b/data/model.py @@ -396,7 +396,7 @@ def get_matching_users(username_prefix, robot_namespace=None, (User.robot == True))) query = (User - .select(User.username, Team.id, User.robot) + .select(User.username, fn.Sum(Team.id), User.robot) .group_by(User.username) .where(direct_user_query))