Switch the search to use SQL query.
This commit is contained in:
parent
a0adffdc8e
commit
540dfd5343
2 changed files with 23 additions and 11 deletions
|
@ -64,11 +64,10 @@ def match_repos_api(prefix):
|
|||
'description': repo.description,
|
||||
}
|
||||
|
||||
matching = model.get_matching_repositories(prefix)
|
||||
repos = [repo_view(repo) for repo in matching
|
||||
if ReadRepositoryPermission(repo.namespace, repo.name).can()]
|
||||
username = current_user.db_user.username
|
||||
matching = model.get_matching_repositories(prefix, username)
|
||||
response = {
|
||||
'repositories': repos
|
||||
'repositories': [repo_view(repo) for repo in matching]
|
||||
}
|
||||
|
||||
return jsonify(response)
|
||||
|
|
Reference in a new issue