diff --git a/CHANGELOG.md b/CHANGELOG.md index b76d08c7..e4f0e04e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. ### Bug Fixes - Fix refreshing of the checks page filtered by tags (#221) - Escape asterisks in Slack messages (#223) +- Fix a "invalid time format" in front.views.status_single on Windows hosts ## 1.5.0 - 2019-02-04 diff --git a/hc/front/tests/test_status_single.py b/hc/front/tests/test_status_single.py index cb806c8a..c494cccc 100644 --- a/hc/front/tests/test_status_single.py +++ b/hc/front/tests/test_status_single.py @@ -29,7 +29,7 @@ class StatusSingleTestCase(BaseTestCase): doc = r.json() self.assertEqual(doc["status"], "up") - self.assertEqual(doc["updated"], p.created.strftime("%s.%f")) + self.assertEqual(doc["updated"], str(p.created.timestamp())) self.assertTrue("test-user-agent" in doc["events"]) def test_it_omits_events(self): diff --git a/hc/front/views.py b/hc/front/views.py index 070248ec..4737e6ce 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -494,7 +494,7 @@ def status_single(request, code): events = _get_events(check, 20) updated = "1" if len(events): - updated = events[0].created.strftime("%s.%f") + updated = str(events[0].created.timestamp()) doc = { "status": status,