diff --git a/frappe/__init__.py b/frappe/__init__.py index 80efc83987..57090ab911 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -210,7 +210,9 @@ def create_folder(path): def set_user(username): from frappe.utils.user import User - local.session["user"] = username + local.session.user = username + local.session.sid = username + local.session.data = {} local.user = User(username) local.restrictions = None local.user_perms = {} diff --git a/frappe/boot.py b/frappe/boot.py index 32e9cb2e07..43a112548a 100644 --- a/frappe/boot.py +++ b/frappe/boot.py @@ -21,7 +21,7 @@ def get_bootinfo(): get_user(bootinfo) # system info - bootinfo['control_panel'] = frappe.get_doc('Control Panel') + bootinfo['control_panel'] = frappe.get_doc('Control Panel').as_dict() bootinfo['sysdefaults'] = frappe.defaults.get_defaults() bootinfo['server_date'] = frappe.utils.nowdate() bootinfo["send_print_in_body_and_attachment"] = frappe.db.get_value("Outgoing Email Settings", diff --git a/frappe/cli.py b/frappe/cli.py index aaf9ae48ec..31ab959dd8 100755 --- a/frappe/cli.py +++ b/frappe/cli.py @@ -79,8 +79,7 @@ def run(fn, args): if args.get("profile") and fn!="serve": pr.disable() s = StringIO.StringIO() - sortby = 'cumulative' - ps = pstats.Stats(pr, stream=s).sort_stats(sortby) + ps = pstats.Stats(pr, stream=s).sort_stats('tottime', 'ncalls') ps.print_stats() print s.getvalue()