Skip to content

Commit 8b77490

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

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
@@ -1886,6 +1886,7 @@ class Meta:
18861886

18871887
class Status(models.TextChoices):
18881888
UNKNOWN = "unknown"
1889+
DISABLED = "disabled"
18891890
RUNNING = "running"
18901891
SUCCESS = "success"
18911892
FAILURE = "failure"
@@ -2239,7 +2240,7 @@ def next_run_date(self):
22392240
@property
22402241
def status(self):
22412242
if not self.is_active:
2242-
return
2243+
return PipelineRun.Status.DISABLED
22432244

22442245
if self.pipelineruns.exists():
22452246
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)