summaryrefslogtreecommitdiffstats
path: root/lava-master/lava-patch/0001-scheduler.jobs.show-fix-missing-value-after-2019.09.patch
blob: 093996de0afdf08d755f2cd39b20a4b18f977d1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/lava_scheduler_app/api/jobs.py b/lava_scheduler_app/api/jobs.py
index 7c9e2cd52..5aba8d88b 100644
--- a/lava_scheduler_app/api/jobs.py
+++ b/lava_scheduler_app/api/jobs.py
@@ -395,6 +395,12 @@ class SchedulerJobsAPI(ExposedV2API):
         device_type = None
         if job.requested_device_type is not None:
             device_type = job.requested_device_type.name
+        if job.is_public:
+            visibility = "Public"
+        else:
+            visibility = "Private (%s)" % ", ".join(
+                    [g.name for g in job.viewing_groups.all()]
+                    )
 
         return {
             "id": job.display_id,
@@ -410,6 +416,7 @@ class SchedulerJobsAPI(ExposedV2API):
             "start_time": job.start_time,
             "end_time": job.end_time,
             "tags": [t.name for t in job.tags.all()],
+            "visibility": visibility,
             "failure_comment": job.failure_comment,
         }