[demo] make it faster, do not send user email

This commit is contained in:
Rushabh Mehta 2017-06-16 16:55:32 +05:30
parent 9a3462031d
commit 73167eae60
2 changed files with 7 additions and 3 deletions

View File

@ -16,8 +16,11 @@ def call_command(cmd, context):
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 @@ def make_demo(context, site, domain='Manufacturing', days=100, resume=False):
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():

View File

@ -116,7 +116,7 @@ def setup_user():
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()