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 @@
/fail
endpoint)
- {% elif ping.start %}
+ {% elif ping.kind == "start" %}
(received via the /start
endpoint)
{% endif %}