Commit c0542e16 authored by Sjoerd Simons's avatar Sjoerd Simons

Merge branch 'T11957-workarounds' into 'collabora/production'

T11957 workarounds

See merge request !9
parents c653eced ce0a353f
Pipeline #20039 passed with stages
in 1 minute and 19 seconds
......@@ -310,15 +310,20 @@ class SchedulerAPI(ExposedV2API):
health=Device.HEALTH_RETIRED
)
devices_jobs = ((
dev,
dev.current_job() if dev.state == Device.STATE_RUNNING else None
) for dev in devices_list)
return [
[
dev.hostname,
dev.device_type.name,
build_device_status_display(dev.state, dev.health),
dev.current_job().pk if dev.current_job() else None,
job.pk if job else None,
True,
]
for dev in devices_list
for dev, job in devices_jobs
]
def all_device_types(self):
......
......@@ -85,6 +85,8 @@ class ExpandedStatusColumn(tables.Column):
"""
if record.state == Device.STATE_RUNNING:
current_job = record.current_job()
if not current_job:
return mark_safe("(no current job)")
return mark_safe( # nosec - internal data
"Running job #%s - %s submitted by %s"
% (pklink(current_job), current_job.description, current_job.submitter)
......
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