Fix is_public in repo list

Fixes #678
This commit is contained in:
Joseph Schorr 2015-10-21 14:13:03 -04:00
parent 8e7b20a0d7
commit 147b7b26b4
2 changed files with 3 additions and 2 deletions

View file

@ -235,7 +235,8 @@ def get_visible_repositories(username, namespace=None, page=None, limit=None, in
return []
query = (Repository
.select(Repository.name, Repository.id, Repository.description, Namespace.username)
.select(Repository.name, Repository.id, Repository.description, Namespace.username,
Repository.visibility)
.distinct()
.switch(Repository)
.join(Namespace, on=(Repository.namespace_user == Namespace.id))

View file

@ -203,7 +203,7 @@ class RepositoryList(ApiResource):
'namespace': repo_obj.namespace_user.username,
'name': repo_obj.name,
'description': repo_obj.description,
'is_public': repo_obj.visibility_id == model.repository.get_public_repo_visibility(),
'is_public': repo_obj.visibility_id == model.repository.get_public_repo_visibility().id,
}
repo_id = repo_obj.id