Commit c56ab4c6 authored by Neil Williams's avatar Neil Williams Committed by Rémi Duraffort
Browse files

Fix logic in pending_jobs_by_device_type

Ensure that the effect of applying the owner_only filter is
active (use a QuerySet, not a list) and stored (updating
the return value).

Change-Id: I811db9f86d489e8ee3f4750ac5e041fb1c97de9d
Signed-off-by: default avatarNeil Williams <>
parent da88d8b4
......@@ -776,14 +776,14 @@ class SchedulerAPI(ExposedAPI):
# Get rest of the devices and put number of pending jobs as 0.
if all:
device_types = DeviceType.objects.values_list('name', flat=True)
device_types = DeviceType.objects.all()
device_types = active_device_types().values_list('name', flat=True)
device_types = active_device_types()
if not self.user or not self.user.is_superuser:
device_types = device_types.filter(owners_only=False)
for device_type in device_types:
for device_type in device_types.values_list('name', flat=True):
if device_type not in pending_jobs_by_device:
pending_jobs_by_device[device_type] = 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment