[demo] make it faster, do not send user email
diff --git a/erpnext/commands/__init__.py b/erpnext/commands/__init__.py
index 6ffa6a3..a991cf9 100644
--- a/erpnext/commands/__init__.py
+++ b/erpnext/commands/__init__.py
@@ -16,8 +16,11 @@
help='Run the demo for so many days. Default 100')
@click.option('--resume', default=False, is_flag=True,
help='Continue running the demo for given days')
+@click.option('--reinstall', default=False, is_flag=True,
+ help='Reinstall site before demo')
@pass_context
-def make_demo(context, site, domain='Manufacturing', days=100, resume=False):
+def make_demo(context, site, domain='Manufacturing', days=100,
+ resume=False, reinstall=False):
"Reinstall site and setup demo"
from frappe.commands.site import _reinstall
from frappe.installer import install_app
@@ -30,7 +33,8 @@
from erpnext.demo import demo
demo.simulate(days=days)
else:
- _reinstall(site, yes=True)
+ if reinstall:
+ _reinstall(site, yes=True)
with frappe.init_site(site=site):
frappe.connect()
if not 'erpnext' in frappe.get_installed_apps():
diff --git a/erpnext/demo/setup/setup_data.py b/erpnext/demo/setup/setup_data.py
index 3675f0f..33f945f 100644
--- a/erpnext/demo/setup/setup_data.py
+++ b/erpnext/demo/setup/setup_data.py
@@ -116,7 +116,7 @@
for u in json.loads(open(frappe.get_app_path('erpnext', 'demo', 'data', 'user.json')).read()):
user = frappe.new_doc("User")
user.update(u)
- user.flags.no_welcome_mail
+ user.flags.no_welcome_mail = True
user.new_password = 'demo'
user.insert()