@@ -78,3 +78,11 @@ var validated = true; | |||||
var validation_message = ''; | var validation_message = ''; | ||||
var tinymce_loaded = null; | var tinymce_loaded = null; | ||||
var cur_autosug = null; | var cur_autosug = null; | ||||
if(!console) { | |||||
var console = { | |||||
log: function(txt) { | |||||
errprint(txt); | |||||
} | |||||
} | |||||
} |
@@ -82,12 +82,6 @@ function Body() { | |||||
this.wrapper = $a($i('body_div'),'div'); | this.wrapper = $a($i('body_div'),'div'); | ||||
this.body = $a(this.wrapper, 'div'); | this.body = $a(this.wrapper, 'div'); | ||||
// sidebars | |||||
if(user_defaults.hide_sidebars) { | |||||
this.cp.left_sidebar_width = null; | |||||
this.cp.right_sidebar_width = null; | |||||
} | |||||
this.setup_page_areas(); | this.setup_page_areas(); | ||||
@@ -22,7 +22,7 @@ def get_bootinfo(): | |||||
del cp[field] | del cp[field] | ||||
# system info | # system info | ||||
bootinfo['control_panel'] = cp | |||||
bootinfo['control_panel'] = cp.copy() | |||||
bootinfo['account_name'] = cp.get('account_id') | bootinfo['account_name'] = cp.get('account_id') | ||||
bootinfo['sysdefaults'] = webnotes.utils.get_defaults() | bootinfo['sysdefaults'] = webnotes.utils.get_defaults() | ||||
@@ -60,15 +60,18 @@ def load(country): | |||||
else: | else: | ||||
raise e | raise e | ||||
def add_to_cache(sd, country): | |||||
def add_to_cache(bootinfo, country): | |||||
"""add to cache""" | """add to cache""" | ||||
import webnotes.model.utils | import webnotes.model.utils | ||||
if sd.get('docs'): | |||||
sd['docs'] = webnotes.model.utils.compress(sd['docs']) | |||||
if bootinfo.get('docs'): | |||||
bootinfo['docs'] = webnotes.model.utils.compress(bootinfo['docs']) | |||||
# delete earlier (?) | # delete earlier (?) | ||||
webnotes.conn.sql("delete from __SessionCache where user=%s and country=%s", (webnotes.session['user'], country)) | |||||
webnotes.conn.sql("""delete from __SessionCache where user=%s | |||||
and country=%s""", (webnotes.session['user'], country)) | |||||
# make new | # make new | ||||
webnotes.conn.sql("insert into `__SessionCache` (user, country, cache) VALUES (%s, %s, %s)", (webnotes.session['user'], country, str(sd))) | |||||
webnotes.conn.sql("""insert into `__SessionCache` | |||||
(user, country, cache) VALUES (%s, %s, %s)""", \ | |||||
(webnotes.session['user'], country, str(bootinfo))) |