fixes in cms2 updates

This commit is contained in:
Anand Doshi 2012-07-12 19:03:58 +05:30
parent d68dceb791
commit 1a51cc9ad0
2 changed files with 5 additions and 3 deletions

View File

@ -4,7 +4,7 @@ def execute():
from webnotes.model.code import get_obj from webnotes.model.code import get_obj
# rewrite pages # rewrite pages
get_obj('Website Settings').rewrite_pages() get_obj('Website Settings').on_update()
ss = get_obj('Style Settings') ss = get_obj('Style Settings')
ss.validate() ss.validate()

View File

@ -167,6 +167,7 @@ def build_html(args):
# cache management # cache management
def search_cache(page_name): def search_cache(page_name):
if not page_name: return ()
import webnotes import webnotes
return webnotes.conn.sql("""\ return webnotes.conn.sql("""\
select html, doc_type, doc_name 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 * if page_name, doc_type and doc_name match, clear cache's copy
* else, raise exception that such a page already exists * else, raise exception that such a page already exists
""" """
import webnotes
if not page_name: if not page_name:
webnotes.conn.sql("""update `tabWeb Cache` set html = ''""") webnotes.conn.sql("""update `tabWeb Cache` set html = ''""")
return return
result = search_cache(page_name) 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): 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', '') webnotes.conn.set_value('Web Cache', page_name, 'html', '')
else: else: