mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-04 05:17:54 +03:00
Refactor user filtering in DeployedServiceStatsCollector to include only valid user services
This commit is contained in:
parent
9b3caed641
commit
99305c17e7
@ -94,9 +94,7 @@ class DeployedServiceStatsCollector(Job):
|
||||
|
||||
total_users, total_assigned, total_users_with_service = 0, 0, 0
|
||||
for auth in models.Authenticator.objects.all():
|
||||
fltr_user = auth.users.filter(userServices__isnull=False).exclude(
|
||||
userServices__state__in=types.states.State.INFO_STATES
|
||||
).order_by()
|
||||
fltr_user = auth.users.filter(userServices__state__in=types.states.State.VALID_STATES).order_by()
|
||||
users = auth.users.all().count()
|
||||
users_with_service = fltr_user.values('id').distinct().count() # Use "values" to simplify query (only id)
|
||||
number_assigned_services = fltr_user.values('id').count()
|
||||
|
Loading…
Reference in New Issue
Block a user