Skip to content

Commit

Permalink
Mark Insight.last_refresh as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed May 8, 2024
1 parent b50c53c commit a73325d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion posthog/api/insight.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion posthog/models/insight.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a73325d

Please sign in to comment.