summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-09-25 15:26:38 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:20 +0100
commitfe6aaa906f8c35cc61d3ddc352fdb4f562d74ceb (patch)
tree62333f93d1363591ea60b2e6b82bf9988bfc0cda /ishtar_common
parenta21d0649b0e0122fdee368307241c6f938a85822 (diff)
downloadIshtar-fe6aaa906f8c35cc61d3ddc352fdb4f562d74ceb.tar.bz2
Ishtar-fe6aaa906f8c35cc61d3ddc352fdb4f562d74ceb.zip
Containers: fix statistics on warehouse sheet
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py9
1 files changed, 5 insertions, 4 deletions
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: