0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-06 13:55:27 +00:00
healthchecks_healthchecks/hc/api/views.py
Pēteris Caune c8b24495b9 Renames
2015-06-12 19:33:15 +03:00

16 lines
362 B
Python

from django.http import HttpResponse, HttpResponseBadRequest
from django.utils import timezone
from hc.api.models import Check
def ping(request, code):
try:
check = Check.objects.get(code=code)
except Check.DoesNotExist:
return HttpResponseBadRequest()
check.last_ping = timezone.now()
check.save()
return HttpResponse()