Merge pull request #16773 from alyf-de/refactor-sync-fixtures

refactor: Sync fixtures
This commit is contained in:
gavin 2022-04-27 10:54:31 +05:30 committed by GitHub
commit af949bc36f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,11 +17,9 @@ def sync_fixtures(app=None):
frappe.flags.in_fixtures = True
for app in apps:
if os.path.exists(frappe.get_app_path(app, "fixtures")):
fixture_files = sorted(os.listdir(frappe.get_app_path(app, "fixtures")))
for fname in fixture_files:
if fname.endswith(".json"):
import_doc(frappe.get_app_path(app, "fixtures", fname))
fixtures_path = frappe.get_app_path(app, "fixtures")
if os.path.exists(fixtures_path):
import_doc(fixtures_path)
import_custom_scripts(app)