mirror of
https://github.com/healthchecks/healthchecks.git
synced 2025-04-14 17:08:29 +00:00
In hc.front.views.ping_details, if a ping does not exist, return a friendly message
This commit is contained in:
parent
b0b6ee3149
commit
c8ccd89af2
4 changed files with 7 additions and 3 deletions
|
@ -21,7 +21,7 @@ All notable changes to this project will be documented in this file.
|
||||||
- Don't trigger "down" notifications when changing schedule interactively in web UI
|
- Don't trigger "down" notifications when changing schedule interactively in web UI
|
||||||
- Fix sendalerts crash loop when encountering a bad cron schedule
|
- Fix sendalerts crash loop when encountering a bad cron schedule
|
||||||
- Stricter cron validation, reject schedules like "At midnight of February 31"
|
- Stricter cron validation, reject schedules like "At midnight of February 31"
|
||||||
- In hc.front.views.ping_details, if a ping does not exist, return 404 instead of 500
|
- In hc.front.views.ping_details, if a ping does not exist, return a friendly message
|
||||||
|
|
||||||
## v1.12.0 - 2020-01-02
|
## v1.12.0 - 2020-01-02
|
||||||
|
|
||||||
|
|
|
@ -58,4 +58,4 @@ class LastPingTestCase(BaseTestCase):
|
||||||
|
|
||||||
self.client.login(username="alice@example.org", password="password")
|
self.client.login(username="alice@example.org", password="password")
|
||||||
r = self.client.get("/checks/%s/pings/123/" % check.code)
|
r = self.client.get("/checks/%s/pings/123/" % check.code)
|
||||||
self.assertEqual(r.status_code, 404)
|
self.assertContains(r, "No additional information is", status_code=200)
|
||||||
|
|
|
@ -427,7 +427,7 @@ def ping_details(request, code, n=None):
|
||||||
try:
|
try:
|
||||||
ping = q.latest("created")
|
ping = q.latest("created")
|
||||||
except Ping.DoesNotExist:
|
except Ping.DoesNotExist:
|
||||||
raise Http404("not found")
|
return render(request, "front/ping_details_not_found.html")
|
||||||
|
|
||||||
ctx = {"check": check, "ping": ping}
|
ctx = {"check": check, "ping": ping}
|
||||||
|
|
||||||
|
|
4
templates/front/ping_details_not_found.html
Normal file
4
templates/front/ping_details_not_found.html
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<div class="modal-body">
|
||||||
|
<h3>Not Found</h3>
|
||||||
|
<p>No additional information is available for this event.</p>
|
||||||
|
</div>
|
Loading…
Add table
Reference in a new issue