From 0920214ecf3100a879e513b7d0333112e0c057ef Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 30 Apr 2012 16:55:09 +0530 Subject: [PATCH] if auto clear cache is specified in conf, do not load doctype from cache --- py/webnotes/model/doctype.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/py/webnotes/model/doctype.py b/py/webnotes/model/doctype.py index cbeaf701d0..322fd317e0 100644 --- a/py/webnotes/model/doctype.py +++ b/py/webnotes/model/doctype.py @@ -40,7 +40,13 @@ class _DocType: """ """ - if form: + # do not load from cache if auto cache clear is enabled + import conf + from_cache = True + if hasattr(conf, 'auto_cache_clear'): + from_cache = not conf.auto_cache_clear + + if form and from_cache: cached_doclist = self.load_from_cache() if cached_doclist: return cached_doclist