Skip to content

Commit d1d292d

Browse files
committed
Show disabled status for inactive pipelines
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent f12f43a commit d1d292d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

vulnerabilities/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2023,6 +2023,7 @@ class Meta:
20232023

20242024
class Status(models.TextChoices):
20252025
UNKNOWN = "unknown"
2026+
DISABLED = "disabled"
20262027
RUNNING = "running"
20272028
SUCCESS = "success"
20282029
FAILURE = "failure"
@@ -2376,7 +2377,7 @@ def next_run_date(self):
23762377
@property
23772378
def status(self):
23782379
if not self.is_active:
2379-
return
2380+
return PipelineRun.Status.DISABLED
23802381

23812382
if self.pipelineruns.exists():
23822383
latest = self.pipelineruns.only("pk").first()

vulnerabilities/templates/includes/job_status.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
<span class="icon has-text-grey mr-1"><i class="fa fa-ban"></i></span>
4141
<span>Stale</span>
4242
{% endif %}
43+
{% elif status == "disabled" %}
44+
{% if compact %}
45+
<i class="fa fa-pause has-text-grey mr-1"></i>Disabled
46+
{% else %}
47+
<span class="icon has-text-grey mr-1"><i class="fa fa-pause"></i></span>
48+
<span>Disabled</span>
49+
{% endif %}
4350
{% else %}
4451
{% if compact %}
4552
<i class="fa fa-question-circle has-text-warning mr-1"></i>Unknown

0 commit comments

Comments
 (0)