Merge pull request #39181 from frappe/mergify/bp/version-15-hotfix/pr-39159

refactor: prevent permission error by always processing bulk transaction in background (backport #39159)
This commit is contained in:
ruthra kumar 2024-01-08 10:30:48 +05:30 committed by GitHub
commit 1eee52c59c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,18 +15,15 @@ def transaction_processing(data, from_doctype, to_doctype):
length_of_data = len(deserialized_data)
if length_of_data > 10:
frappe.msgprint(
_("Started a background job to create {1} {0}").format(to_doctype, length_of_data)
)
frappe.enqueue(
job,
deserialized_data=deserialized_data,
from_doctype=from_doctype,
to_doctype=to_doctype,
)
else:
job(deserialized_data, from_doctype, to_doctype)
frappe.msgprint(
_("Started a background job to create {1} {0}").format(to_doctype, length_of_data)
)
frappe.enqueue(
job,
deserialized_data=deserialized_data,
from_doctype=from_doctype,
to_doctype=to_doctype,
)
@frappe.whitelist()