diff --git a/hc/api/management/commands/backfillchannels.py b/hc/api/management/commands/backfillchannels.py index a0ab0a45..bec56968 100644 --- a/hc/api/management/commands/backfillchannels.py +++ b/hc/api/management/commands/backfillchannels.py @@ -13,7 +13,7 @@ class Command(BaseCommand): q = Channel.objects.filter(id=channel.id) try: - n = channel.latest_notification() + n = Notification.objects.filter(channel=channel).latest() q.update(last_notify=n.created, last_error=n.error) total += 1 except Notification.DoesNotExist: diff --git a/hc/api/models.py b/hc/api/models.py index 3d63b8f3..dd308ceb 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -550,9 +550,6 @@ class Channel(models.Model): def icon_path(self): return "img/integrations/%s.png" % self.kind - def latest_notification(self): - return Notification.objects.filter(channel=self).latest() - @property def json(self): return json.loads(self.value) diff --git a/templates/front/channels.html b/templates/front/channels.html index 0b448f32..76355274 100644 --- a/templates/front/channels.html +++ b/templates/front/channels.html @@ -26,7 +26,6 @@