From d93a8b60338bd8c8c7fd84fddf9e5d43a2d95e45 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Fri, 27 Dec 2013 17:06:27 -0500 Subject: [PATCH] Use group_by to eliminate duplicates in the entity search. --- data/model.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/model.py b/data/model.py index 898740d33..3414c4a08 100644 --- a/data/model.py +++ b/data/model.py @@ -397,6 +397,7 @@ def get_matching_users(username_prefix, robot_namespace=None, query = (User .select(User.username, Team.id, User.robot) + .group_by(User.username) .where(direct_user_query)) if organization: @@ -408,8 +409,6 @@ def get_matching_users(username_prefix, robot_namespace=None, class MatchingUserResult(object): def __init__(self, *args): - logger.debug("tuple: %s" % str(args)) - self.username = args[0] self.is_robot = args[2] if organization: