Fix redirects.

This commit is contained in:
Pēteris Caune 2018-08-19 13:11:00 +03:00
parent ecba1eb40b
commit 3021e1c944
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2

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,