Merge pull request #1724 from coreos-inc/public-order-by

Hack to temporarily fix pagination over public repos
This commit is contained in:
josephschorr 2016-08-13 14:23:18 -04:00 committed by GitHub
commit cbc9ec7848

View file

@ -159,7 +159,14 @@ class RepositoryList(ApiResource):
repo_query = model.repository.get_user_starred_repositories(user)
else:
repo_query = model.repository.get_visible_repositories(username=username,
# TEMP: Only supply the filter username if a specific namespace is requested. If the request
# is for all public repositories, simply return them. This ensures that we don't paginate
# over a union query.
# TODO(jschorr): Fix pagination for union queries so we can remove this restriction!
filter_username = (username if not parsed_args['namespace'] and not parsed_args['starred']
else None)
repo_query = model.repository.get_visible_repositories(username=filter_username,
include_public=parsed_args['public'],
namespace=parsed_args['namespace'])