Add option to disable partial autocompletion of users
This commit is contained in:
parent
6600b380ca
commit
c6aad5fef0
4 changed files with 29 additions and 2 deletions
|
@ -605,8 +605,12 @@ def get_matching_user_namespaces(namespace_prefix, username, limit=10):
|
|||
|
||||
return _basequery.filter_to_repos_for_user(base_query, username).limit(limit)
|
||||
|
||||
def get_matching_users(username_prefix, robot_namespace=None, organization=None, limit=20):
|
||||
def get_matching_users(username_prefix, robot_namespace=None, organization=None, limit=20,
|
||||
exact_matches_only=False):
|
||||
user_search = prefix_search(User.username, username_prefix)
|
||||
if exact_matches_only:
|
||||
user_search = (User.username == username_prefix)
|
||||
|
||||
direct_user_query = (user_search & (User.organization == False) & (User.robot == False))
|
||||
|
||||
if robot_namespace:
|
||||
|
|
Reference in a new issue