Merge pull request #252 from coreos-inc/sqlfix

Small SQL query fix
This commit is contained in:
Jimmy Zelinskie 2015-07-21 13:45:33 -07:00
commit bb269a56b6
2 changed files with 12 additions and 0 deletions

View file

@ -179,6 +179,9 @@ def get_action_counts(repository_ids):
def get_visible_repositories(username=None, include_public=True, page=None,
limit=None, namespace=None, namespace_only=False):
if not include_public and not username:
return []
fields = [Repository.name, Repository.id, Repository.description, Visibility.name,
Namespace.username]

View file

@ -1305,6 +1305,15 @@ class TestListRepos(ApiTestCase):
for repo in json['repositories']:
self.assertEquals(ORGANIZATION, repo['namespace'])
def test_listrepos_asguest_allparams(self):
json = self.getJsonResponse(RepositoryList,
params=dict(namespace=ORGANIZATION,
public=False,
last_modified=True))
for repo in json['repositories']:
self.assertEquals(ORGANIZATION, repo['namespace'])
class TestViewPublicRepository(ApiTestCase):
def test_normalview(self):