Filter out deleted users and organizations from the superuser list
Superusers were getting confused because the users/orgs were being disabled and renamed, but still appeared in the list until they were GCed by the background worker. Now we just hide them. Fixes https://jira.coreos.com/browse/QUAY-936
This commit is contained in:
parent
7878435805
commit
b98c65b3a3
4 changed files with 55 additions and 7 deletions
|
@ -825,10 +825,17 @@ def get_private_repo_count(username):
|
|||
.count())
|
||||
|
||||
|
||||
def get_active_users(disabled=True):
|
||||
query = User.select().where(User.organization == False, User.robot == False)
|
||||
def get_active_users(disabled=True, deleted=False):
|
||||
query = (User
|
||||
.select()
|
||||
.where(User.organization == False, User.robot == False))
|
||||
|
||||
if not disabled:
|
||||
query = query.where(User.enabled == True)
|
||||
|
||||
if not deleted:
|
||||
query = query.where(User.id.not_in(DeletedNamespace.select(DeletedNamespace.namespace)))
|
||||
|
||||
return query
|
||||
|
||||
|
||||
|
|
Reference in a new issue