Merge pull request #641 from coreos-inc/wildcardfix

Make sure to filter wildcard queries
This commit is contained in:
josephschorr 2015-10-15 14:26:51 -04:00
commit 2f42a4d94d
4 changed files with 33 additions and 17 deletions

View file

@ -317,11 +317,11 @@ def get_sorted_matching_repositories(prefix, only_public, checker, limit=10):
# For performance reasons, we conduct the repo name and repo namespace searches on their
# own. This also affords us the ability to give higher precedence to repository names matching
# over namespaces, which is semantically correct.
get_search_results(Repository.name ** (prefix + '%'), with_count=True)
get_search_results(Repository.name ** (prefix + '%'), with_count=False)
get_search_results(_basequery.prefix_search(Repository.name, prefix), with_count=True)
get_search_results(_basequery.prefix_search(Repository.name, prefix), with_count=False)
get_search_results(Namespace.username ** (prefix + '%'), with_count=True)
get_search_results(Namespace.username ** (prefix + '%'), with_count=False)
get_search_results(_basequery.prefix_search(Namespace.username, prefix), with_count=True)
get_search_results(_basequery.prefix_search(Namespace.username, prefix), with_count=False)
return results