Преглед изворни кода

fix: Code cleanup

version-14
Deepesh Garg пре 3 година
родитељ
комит
f23eb73b2a
3 измењених фајлова са 10 додато и 9 уклоњено
  1. +5
    -2
      frappe/core/doctype/data_import/data_import.js
  2. +4
    -6
      frappe/core/doctype/data_import/importer.py
  3. +1
    -1
      frappe/core/doctype/data_import_log/data_import_log.json

+ 5
- 2
frappe/core/doctype/data_import/data_import.js Прегледај датотеку

@@ -81,7 +81,10 @@ frappe.ui.form.on('Data Import', {
frm.trigger('show_import_log');
frm.trigger('show_import_warnings');
frm.trigger('toggle_submit_after_import');
frm.trigger('show_import_status');

if (frm.doc.status != 'Pending')
frm.trigger('show_import_status');

frm.trigger('show_report_error_button');

if (frm.doc.status === 'Partial Success') {
@@ -164,7 +167,7 @@ frappe.ui.form.on('Data Import', {
: __('Successfully imported {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.', message_args);
} else {
message =
successful_records> 1
successful_records > 1
? __('Successfully updated {0} records out of {1}. Click on Export Errored Rows, fix the errors and import again.', message_args)
: __('Successfully updated {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.', message_args);
}


+ 4
- 6
frappe/core/doctype/data_import/importer.py Прегледај датотеку

@@ -156,11 +156,11 @@ class Importer:
},
)

import_log.append(create_import_log(self.data_import.name, log_index, {
create_import_log(self.data_import.name, log_index, {
'success': True,
'docname': doc.name,
'row_indexes': row_indexes
}))
})

log_index += 1

@@ -177,15 +177,13 @@ class Importer:
# rollback if exception
frappe.db.rollback()

import_log.append(create_import_log(self.data_import.name, log_index, {
create_import_log(self.data_import.name, log_index, {
'success': False,
'exception': frappe.get_traceback(),
'messages': messages,
'row_indexes': row_indexes
}))
})

# commit after creating log for failure
frappe.db.commit()
log_index += 1

# Logs are db inserted directly so will have to be fetched again


+ 1
- 1
frappe/core/doctype/data_import_log/data_import_log.json Прегледај датотеку

@@ -60,7 +60,7 @@
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-12-28 11:19:19.646076",
"modified": "2021-12-29 11:19:19.646076",
"modified_by": "Administrator",
"module": "Core",
"name": "Data Import Log",


Loading…
Откажи
Сачувај