[setup] bundle up fixtures and setup docs

This commit is contained in:
Prateeksha Singh 2018-11-14 10:26:58 +05:30
parent dabf349599
commit c1c057611e

View File

@ -124,18 +124,16 @@ def login_as_first_user(args):
frappe.local.login_manager.login_as(args.get("email")) frappe.local.login_manager.login_as(args.get("email"))
@frappe.whitelist() @frappe.whitelist()
def install_fixtures(config=None): def install_fixtures():
if not config: config = get_journeys_config().get('setup_config') or {}
config = get_journeys_config().get('setup_config') or {}
update_global_settings(_dict(config)) update_global_settings(_dict(config))
fixtures.install(_dict(config).country) fixtures.install(_dict(config).country)
@frappe.whitelist() @frappe.whitelist()
def make_setup_docs(args, config=None): def make_setup_docs(args):
if not config: config = get_journeys_config().get('setup_config') or {}
config = get_journeys_config().get('setup_config') or {}
args = json.loads(args) args = json.loads(args)
@ -146,6 +144,10 @@ def make_setup_docs(args, config=None):
run_post_setup_complete(args) run_post_setup_complete(args)
@frappe.whitelist()
def setup(args, config=None):
install_fixtures()
make_setup_docs(args)
def get_fy_details(fy_start_date, fy_end_date): def get_fy_details(fy_start_date, fy_end_date):
start_year = getdate(fy_start_date).year start_year = getdate(fy_start_date).year