示例#1
0
 def get_last_refresh(self, dashboard_item: Insight):
     result = self.get_result(dashboard_item)
     if result is not None:
         return dashboard_item.last_refresh
     dashboard_item.last_refresh = None
     dashboard_item.save()
     return None
示例#2
0
    def get_last_refresh(self, insight: Insight):
        if self.context["request"].GET.get("refresh"):
            return now()

        result = self.get_result(insight)
        if result is not None:
            return insight.last_refresh
        insight.last_refresh = None
        insight.save()
        return None
示例#3
0
    def get_last_refresh(self, insight: Insight):
        if should_refresh(self.context["request"]):
            return now()

        result = self.get_result(insight)
        if result is not None:
            return insight.last_refresh
        if insight.last_refresh is not None:
            # Update last_refresh without updating "updated_at" (insight edit date)
            insight.last_refresh = None
            insight.save()
        return None