Merge branch 'master' into dev

This commit is contained in:
Anand Doshi 2012-07-13 08:53:17 +05:30
commit 158e7751a8
2 changed files with 8 additions and 7 deletions

View File

@ -41,7 +41,7 @@ def cleanup():
try:
webnotes.model.delete_doc('Page', page)
except Exception, e:
webnotes.modules.patch_handler.log(str(e))
webnotes.modules.patch_handler.log(unicode(e))
import os
import conf
@ -74,7 +74,7 @@ def save_pages():
try:
DocList(dt, result['name'].encode('utf-8')).save()
except Exception, e:
webnotes.modules.patch_handler.log(str(e))
webnotes.modules.patch_handler.log(unicode(e))
def save_website_settings():
from webnotes.model.code import get_obj

View File

@ -225,6 +225,8 @@ def refresh_cache(build=None):
# webnotes.conn.sql("delete from `tabWeb Cache`")
clear_cache(None)
query_map = {
'Web Page': """select page_name, name from `tabWeb Page` where docstatus=0""",
'Blog': """\
@ -236,12 +238,11 @@ def refresh_cache(build=None):
}
for dt in query_map:
if build and dt in build:
for result in webnotes.conn.sql(query_map[dt], as_dict=1):
create_cache(result['page_name'], dt, result['name'])
clear_cache(result['page_name'], dt, result['name'])
if build and dt in build: load_into_cache(result['page_name'])
load_into_cache(result['page_name'])
for page_name in get_predefined_pages():
create_cache(page_name, None, None)
clear_cache(page_name, None, None)
if build: load_into_cache(page_name)