diff options
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 |
commit | 011fff384002b8e75dc69e46b884cb2b9e42b140 (patch) | |
tree | 62333f93d1363591ea60b2e6b82bf9988bfc0cda /ishtar_common/models.py | |
parent | 2d35da2cd7c32dc0938d5235838d5488b319e8c9 (diff) | |
download | Ishtar-011fff384002b8e75dc69e46b884cb2b9e42b140.tar.bz2 Ishtar-011fff384002b8e75dc69e46b884cb2b9e42b140.zip |
Containers: fix statistics on warehouse sheet
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 9 |
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: |