You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
362 B

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. from django.http import HttpResponse, HttpResponseBadRequest
  2. from django.utils import timezone
  3. from hc.api.models import Check
  4. def ping(request, code):
  5. try:
  6. check = Check.objects.get(code=code)
  7. except Check.DoesNotExist:
  8. return HttpResponseBadRequest()
  9. check.last_ping = timezone.now()
  10. check.save()
  11. return HttpResponse()