diff --git a/posthog/api/insight.py b/posthog/api/insight.py index d0d540b2fcdbc3..a3c4b06cd4c1f7 100644 --- a/posthog/api/insight.py +++ b/posthog/api/insight.py @@ -335,7 +335,6 @@ def create(self, validated_data: dict, *args: Any, **kwargs: Any) -> Insight: raise serializers.ValidationError("Dashboard not found") DashboardTile.objects.create(insight=insight, dashboard=dashboard, last_refresh=now()) - insight.last_refresh = now() # set last refresh if the insight is on at least one dashboard # Manual tag creation since this create method doesn't call super() self._attempt_set_tags(tags, insight) diff --git a/posthog/models/insight.py b/posthog/models/insight.py index a3bc310cb70099..8a123680dfcd0d 100644 --- a/posthog/models/insight.py +++ b/posthog/models/insight.py @@ -43,7 +43,6 @@ class Insight(models.Model): deleted: models.BooleanField = models.BooleanField(default=False) saved: models.BooleanField = models.BooleanField(default=False) created_at: models.DateTimeField = models.DateTimeField(null=True, blank=True, auto_now_add=True) - last_refresh: models.DateTimeField = models.DateTimeField(blank=True, null=True) refreshing: models.BooleanField = models.BooleanField(default=False) created_by: models.ForeignKey = models.ForeignKey("User", on_delete=models.SET_NULL, null=True, blank=True) # Indicates if it's a sample graph generated by dashboard templates @@ -69,6 +68,8 @@ class Insight(models.Model): null=True, blank=True, ) + # DEPRECATED: within cached results package now + last_refresh: models.DateTimeField = models.DateTimeField(blank=True, null=True) # DEPRECATED: on dashboard_insight now layouts: models.JSONField = models.JSONField(default=dict) # DEPRECATED: on dashboard_insight now