Switch the search to use SQL query.

This commit is contained in:
yackob03 2013-09-27 23:25:57 -04:00
parent a0adffdc8e
commit 540dfd5343
2 changed files with 23 additions and 11 deletions

View file

@ -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)