refactor(treewide): formatting and ruff fixes, + manually enabled F401
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
diff --git a/erpnext/utilities/bulk_transaction.py b/erpnext/utilities/bulk_transaction.py
index 343a881..bff83f9 100644
--- a/erpnext/utilities/bulk_transaction.py
+++ b/erpnext/utilities/bulk_transaction.py
@@ -18,9 +18,7 @@
length_of_data = len(deserialized_data)
- frappe.msgprint(
- _("Started a background job to create {1} {0}").format(to_doctype, length_of_data)
- )
+ frappe.msgprint(_("Started a background job to create {1} {0}").format(to_doctype, length_of_data))
frappe.enqueue(
job,
deserialized_data=deserialized_data,
@@ -61,7 +59,7 @@
try:
frappe.db.savepoint("before_creation_state")
task(log.transaction_name, log.from_doctype, log.to_doctype)
- except Exception as e:
+ except Exception:
frappe.db.rollback(save_point="before_creation_state")
update_log(log.name, "Failed", 1, str(frappe.get_traceback(with_context=True)))
else:
@@ -87,7 +85,7 @@
doc_name = d.get("name")
frappe.db.savepoint("before_creation_state")
task(doc_name, from_doctype, to_doctype)
- except Exception as e:
+ except Exception:
frappe.db.rollback(save_point="before_creation_state")
fail_count += 1
create_log(
@@ -99,9 +97,7 @@
log_date=str(date.today()),
)
else:
- create_log(
- doc_name, None, from_doctype, to_doctype, status="Success", log_date=str(date.today())
- )
+ create_log(doc_name, None, from_doctype, to_doctype, status="Success", log_date=str(date.today()))
show_job_status(fail_count, len(deserialized_data), to_doctype)