From 8db093b4c6dedc6f326c7bb786221a50006383e7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 27 Sep 2013 14:08:55 +0530 Subject: [PATCH] [minor] update password --- utilities/demo/make_demo.py | 1 + utilities/demo/make_erpnext_demo.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/utilities/demo/make_demo.py b/utilities/demo/make_demo.py index 6c6ccab4df..4f30df62be 100644 --- a/utilities/demo/make_demo.py +++ b/utilities/demo/make_demo.py @@ -40,6 +40,7 @@ def make(reset=False, simulate=True): if reset: setup() else: + webnotes.conn.close() webnotes.connect(db_name=webnotes.conf.demo_db_name) if simulate: diff --git a/utilities/demo/make_erpnext_demo.py b/utilities/demo/make_erpnext_demo.py index 50c66a3233..a57441b556 100644 --- a/utilities/demo/make_erpnext_demo.py +++ b/utilities/demo/make_erpnext_demo.py @@ -8,7 +8,6 @@ import utilities.demo.make_demo def make_demo_app(site=None): webnotes.mute_emails = 1 webnotes.init(site=site) - webnotes.connect(db_name=webnotes.conf.demo_db_name, site=site) utilities.demo.make_demo.make(reset=True, simulate=False) # setup demo user etc so that the site it up faster, while the data loads @@ -18,6 +17,8 @@ def make_demo_app(site=None): utilities.demo.make_demo.make(reset=False, simulate=True) def make_demo_user(): + from webnotes.auth import _update_password + roles = ["Accounts Manager", "Analytics", "Expense Approver", "Accounts User", "Leave Approver", "Blogger", "Customer", "Sales Manager", "Employee", "Support Manager", "HR Manager", "HR User", "Maintenance Manager", "Maintenance User", "Material Manager", @@ -44,10 +45,10 @@ def make_demo_user(): p.doc.last_name = "User" p.doc.enabled = 1 p.doc.user_type = "ERPNext Demo" - p.doc.new_password = "demo" p.insert() add_roles(p) p.save() + _update_password("demo@erpnext.com", "demo") # make system manager user if webnotes.conn.exists("Profile", "admin@erpnext.com"): @@ -59,11 +60,11 @@ def make_demo_user(): p.doc.last_name = "User" p.doc.enabled = 1 p.doc.user_type = "System User" - p.doc.new_password = "admin010123" p.insert() roles.append("System Manager") add_roles(p) p.save() + _update_password("admin@erpnext.com", "admin010123") # only read for newsletter webnotes.conn.sql("""update `tabDocPerm` set `write`=0, `create`=0, `cancel`=0