From fe6aaa906f8c35cc61d3ddc352fdb4f562d74ceb Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 25 Sep 2020 15:26:38 +0200 Subject: Containers: fix statistics on warehouse sheet --- ishtar_common/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index d26a64e38..2d3320e2e 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3406,15 +3406,16 @@ class DashboardFormItem(object): def _get_or_set_stats(self, funcname, update, timeout=settings.CACHE_TIMEOUT, expected_type=None): + values = {} + from_cache = False model_name = self._meta.app_label + "." + self._meta.model_name sc, __ = StatsCache.objects.get_or_create( model=model_name, model_pk=self.pk ) now = datetime.datetime.now() - values = {} - from_cache = False - if not update and sc.values and funcname in sc.values and ( - sc.updated + datetime.timedelta(seconds=timeout)) > now: + if not settings.DEBUG and ( + not update and sc.values and funcname in sc.values and ( + sc.updated + datetime.timedelta(seconds=timeout)) > now): values = sc.values from_cache = True if funcname not in values: -- cgit v1.2.3