From 1a51cc9ad087d7eaf1d4336254895d947cd1fedd Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 12 Jul 2012 19:03:58 +0530 Subject: [PATCH] fixes in cms2 updates --- erpnext/patches/may_2012/cms.py | 2 +- erpnext/website/web_cache.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/may_2012/cms.py b/erpnext/patches/may_2012/cms.py index 2711b1d1b40..21ee3815bf6 100644 --- a/erpnext/patches/may_2012/cms.py +++ b/erpnext/patches/may_2012/cms.py @@ -4,7 +4,7 @@ def execute(): from webnotes.model.code import get_obj # rewrite pages - get_obj('Website Settings').rewrite_pages() + get_obj('Website Settings').on_update() ss = get_obj('Style Settings') ss.validate() diff --git a/erpnext/website/web_cache.py b/erpnext/website/web_cache.py index d332802fdae..18b10b6809a 100644 --- a/erpnext/website/web_cache.py +++ b/erpnext/website/web_cache.py @@ -167,6 +167,7 @@ def build_html(args): # cache management def search_cache(page_name): + if not page_name: return () import webnotes return webnotes.conn.sql("""\ select html, doc_type, doc_name @@ -193,13 +194,14 @@ def clear_cache(page_name, doc_type=None, doc_name=None): * if page_name, doc_type and doc_name match, clear cache's copy * else, raise exception that such a page already exists """ + import webnotes + if not page_name: webnotes.conn.sql("""update `tabWeb Cache` set html = ''""") return result = search_cache(page_name) - - import webnotes + if not doc_type or (result and result[0][1] == doc_type and result[0][2] == doc_name): webnotes.conn.set_value('Web Cache', page_name, 'html', '') else: