diff options
Diffstat (limited to 'ishtar_common')
-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: |