diff --git a/hc/api/models.py b/hc/api/models.py index bc2cda39..1612a80d 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -765,9 +765,6 @@ class Channel(models.Model): class Notification(models.Model): - class Meta: - get_latest_by = "created" - code = models.UUIDField(default=uuid.uuid4, null=True, editable=False) owner = models.ForeignKey(Check, models.CASCADE, null=True) check_status = models.CharField(max_length=6) @@ -775,6 +772,9 @@ class Notification(models.Model): created = models.DateTimeField(auto_now_add=True) error = models.CharField(max_length=200, blank=True) + class Meta: + get_latest_by = "created" + def status_url(self): path = reverse("hc-api-notification-status", args=[self.code]) return settings.SITE_ROOT + path