diff --git a/hc/front/tests/test_ping_details.py b/hc/front/tests/test_ping_details.py index 1b26e8b1..b1c96f19 100644 --- a/hc/front/tests/test_ping_details.py +++ b/hc/front/tests/test_ping_details.py @@ -18,7 +18,7 @@ class LastPingTestCase(BaseTestCase): check = Check(user=self.alice) check.save() - Ping.objects.create(owner=check, fail=True) + Ping.objects.create(owner=check, kind="fail") self.client.login(username="alice@example.org", password="password") r = self.client.get("/checks/%s/last_ping/" % check.code) @@ -28,7 +28,7 @@ class LastPingTestCase(BaseTestCase): check = Check(user=self.alice) check.save() - Ping.objects.create(owner=check, start=True) + Ping.objects.create(owner=check, kind="start") self.client.login(username="alice@example.org", password="password") r = self.client.get("/checks/%s/last_ping/" % check.code) diff --git a/hc/front/views.py b/hc/front/views.py index 5a220cfd..668189b7 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -377,7 +377,7 @@ def _get_events(check, limit): prev = None for ping in pings: - if ping.start and prev and not prev.start: + if ping.kind == "start" and prev and prev.kind != "start": delta = prev.created - ping.created if delta < ONE_HOUR: setattr(prev, "delta", delta) diff --git a/templates/front/details_events.html b/templates/front/details_events.html index 14133174..08593bf4 100644 --- a/templates/front/details_events.html +++ b/templates/front/details_events.html @@ -10,9 +10,9 @@ - {% if event.fail %} + {% if event.kind == "fail" %} Failure - {% elif event.start %} + {% elif event.kind == "start" %} Started {% else %} OK diff --git a/templates/front/log.html b/templates/front/log.html index bf0a1f15..22a9db65 100644 --- a/templates/front/log.html +++ b/templates/front/log.html @@ -44,9 +44,9 @@ - {% if event.fail %} + {% if event.kind == "fail" %} Failure - {% elif event.start %} + {% elif event.kind == "start" %} Started {% else %} OK diff --git a/templates/front/ping_details.html b/templates/front/ping_details.html index d273657c..f2be8872 100644 --- a/templates/front/ping_details.html +++ b/templates/front/ping_details.html @@ -1,8 +1,8 @@