fix: Drop deprecated validate_csv_import_file def

This commit is contained in:
Gavin D'souza 2021-07-13 12:04:18 +05:30
parent baea532c3d
commit 2aa2586a0c
2 changed files with 3 additions and 17 deletions

View file

@ -171,9 +171,6 @@ def import_file(
i.import_data()
##############
def import_doc(path, pre_process=None):
if os.path.isdir(path):
files = [os.path.join(path, f) for f in os.listdir(path)]
@ -192,19 +189,8 @@ def import_doc(path, pre_process=None):
)
frappe.flags.mute_emails = False
frappe.db.commit()
elif f.endswith(".csv"):
validate_csv_import_file(f)
frappe.db.commit()
def validate_csv_import_file(path):
if path.endswith(".csv"):
print()
print("This method is deprecated.")
print('Import CSV files using the command "bench --site sitename data-import"')
print("Or use the method frappe.core.doctype.data_import.data_import.import_file")
print()
raise Exception("Method deprecated")
else:
raise NotImplementedError("Only .json files can be imported")
def export_json(

View file

@ -20,7 +20,7 @@ def sync_fixtures(app=None):
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") or fname.endswith(".csv"):
if fname.endswith(".json"):
import_doc(frappe.get_app_path(app, "fixtures", fname))
import_custom_scripts(app)