Browse Source

Fix redirects.

pull/193/head
Pēteris Caune 6 years ago
parent
commit
3021e1c944
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      hc/front/views.py

+ 8
- 8
hc/front/views.py View File

@ -210,8 +210,8 @@ def update_name(request, code):
check.tags = form.cleaned_data["tags"]
check.save()
if "/log/" in request.META.get("HTTP_REFERER", ""):
return redirect("hc-log", code)
if "/details/" in request.META.get("HTTP_REFERER", ""):
return redirect("hc-details", code)
return redirect("hc-checks")
@ -247,8 +247,8 @@ def update_timeout(request, code):
check.save()
if "/log/" in request.META.get("HTTP_REFERER", ""):
return redirect("hc-log", code)
if "/details/" in request.META.get("HTTP_REFERER", ""):
return redirect("hc-details", code)
return redirect("hc-checks")
@ -307,8 +307,8 @@ def pause(request, code):
check.status = "paused"
check.save()
if "/log/" in request.META.get("HTTP_REFERER", ""):
return redirect("hc-log", code)
if "/details/" in request.META.get("HTTP_REFERER", ""):
return redirect("hc-details", code)
return redirect("hc-checks")
@ -384,9 +384,9 @@ def status_single(request, code):
status = check.get_status()
events = _get_events(check, 20)
updated = None
updated = "1"
if len(events):
updated = events[0].created.replace(tzinfo=None).isoformat()
updated = events[0].created.strftime("%s.%f")
doc = {
"status": status,


Loading…
Cancel
Save