parent
36fa93a0fb
commit
1eec6f53b2
4 changed files with 27 additions and 14 deletions
|
@ -231,10 +231,10 @@ def get_visible_repositories(username, namespace=None, include_public=False):
|
|||
""" Returns the repositories visible to the given user (if any).
|
||||
"""
|
||||
if not include_public and not username:
|
||||
return []
|
||||
return Repository.select().where(Repository.id == -1)
|
||||
|
||||
query = (Repository
|
||||
.select(Repository.name, Repository.id.alias('id'), Repository.description, Namespace.username,
|
||||
.select(Repository.name, Repository.id.alias('rid'), Repository.description, Namespace.username,
|
||||
Repository.visibility)
|
||||
.distinct()
|
||||
.switch(Repository)
|
||||
|
|
Reference in a new issue