Cleanup some indentation and imports
This commit is contained in:
parent
fff016d0f5
commit
8d5f4466d6
3 changed files with 34 additions and 33 deletions
|
@ -46,7 +46,8 @@ def filter_to_repos_for_user(query, username=None, namespace=None, include_publi
|
||||||
where_clause = (Namespace.username == namespace)
|
where_clause = (Namespace.username == namespace)
|
||||||
|
|
||||||
if include_public:
|
if include_public:
|
||||||
queries.append(query.clone()
|
queries.append(query
|
||||||
|
.clone()
|
||||||
.where(Repository.visibility == get_public_repo_visibility(), where_clause))
|
.where(Repository.visibility == get_public_repo_visibility(), where_clause))
|
||||||
|
|
||||||
if username:
|
if username:
|
||||||
|
@ -57,13 +58,15 @@ def filter_to_repos_for_user(query, username=None, namespace=None, include_publi
|
||||||
AdminUser = User.alias()
|
AdminUser = User.alias()
|
||||||
|
|
||||||
# Add repositories in which the user has permission.
|
# Add repositories in which the user has permission.
|
||||||
queries.append(query.clone()
|
queries.append(query
|
||||||
|
.clone()
|
||||||
.switch(RepositoryPermission)
|
.switch(RepositoryPermission)
|
||||||
.join(User)
|
.join(User)
|
||||||
.where(User.username == username, where_clause))
|
.where(User.username == username, where_clause))
|
||||||
|
|
||||||
# Add repositories in which the user is a member of a team that has permission.
|
# Add repositories in which the user is a member of a team that has permission.
|
||||||
queries.append(query.clone()
|
queries.append(query
|
||||||
|
.clone()
|
||||||
.switch(RepositoryPermission)
|
.switch(RepositoryPermission)
|
||||||
.join(Team)
|
.join(Team)
|
||||||
.join(TeamMember)
|
.join(TeamMember)
|
||||||
|
@ -71,7 +74,8 @@ def filter_to_repos_for_user(query, username=None, namespace=None, include_publi
|
||||||
.where(UserThroughTeam.username == username, where_clause))
|
.where(UserThroughTeam.username == username, where_clause))
|
||||||
|
|
||||||
# Add repositories under namespaces in which the user is the org admin.
|
# Add repositories under namespaces in which the user is the org admin.
|
||||||
queries.append(query.clone()
|
queries.append(query
|
||||||
|
.clone()
|
||||||
.switch(Repository)
|
.switch(Repository)
|
||||||
.join(Org, on=(Repository.namespace_user == Org.id))
|
.join(Org, on=(Repository.namespace_user == Org.id))
|
||||||
.join(AdminTeam, on=(Org.id == AdminTeam.organization))
|
.join(AdminTeam, on=(Org.id == AdminTeam.organization))
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
from multiprocessing import Queue
|
|
||||||
import os
|
|
||||||
|
|
||||||
class QueueFile(object):
|
class QueueFile(object):
|
||||||
""" Class which implements a file-like interface and reads from a blocking
|
""" Class which implements a file-like interface and reads from a blocking
|
||||||
multiprocessing queue.
|
multiprocessing queue.
|
||||||
|
|
Reference in a new issue