Use group_by to eliminate duplicates in the entity search.
This commit is contained in:
parent
e23bee99ec
commit
d93a8b6033
1 changed files with 1 additions and 2 deletions
|
@ -397,6 +397,7 @@ def get_matching_users(username_prefix, robot_namespace=None,
|
||||||
|
|
||||||
query = (User
|
query = (User
|
||||||
.select(User.username, Team.id, User.robot)
|
.select(User.username, Team.id, User.robot)
|
||||||
|
.group_by(User.username)
|
||||||
.where(direct_user_query))
|
.where(direct_user_query))
|
||||||
|
|
||||||
if organization:
|
if organization:
|
||||||
|
@ -408,8 +409,6 @@ def get_matching_users(username_prefix, robot_namespace=None,
|
||||||
|
|
||||||
class MatchingUserResult(object):
|
class MatchingUserResult(object):
|
||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
logger.debug("tuple: %s" % str(args))
|
|
||||||
|
|
||||||
self.username = args[0]
|
self.username = args[0]
|
||||||
self.is_robot = args[2]
|
self.is_robot = args[2]
|
||||||
if organization:
|
if organization:
|
||||||
|
|
Reference in a new issue