refactor: prevent permissions by always processing in background
(cherry picked from commit 15dc5c7e9966e3bf06ec0aa951d7185fb6cf6d0e)
This commit is contained in:
parent
f3882a854f
commit
f0bc0aa676
@ -15,18 +15,15 @@ def transaction_processing(data, from_doctype, to_doctype):
|
|||||||
|
|
||||||
length_of_data = len(deserialized_data)
|
length_of_data = len(deserialized_data)
|
||||||
|
|
||||||
if length_of_data > 10:
|
frappe.msgprint(
|
||||||
frappe.msgprint(
|
_("Started a background job to create {1} {0}").format(to_doctype, length_of_data)
|
||||||
_("Started a background job to create {1} {0}").format(to_doctype, length_of_data)
|
)
|
||||||
)
|
frappe.enqueue(
|
||||||
frappe.enqueue(
|
job,
|
||||||
job,
|
deserialized_data=deserialized_data,
|
||||||
deserialized_data=deserialized_data,
|
from_doctype=from_doctype,
|
||||||
from_doctype=from_doctype,
|
to_doctype=to_doctype,
|
||||||
to_doctype=to_doctype,
|
)
|
||||||
)
|
|
||||||
else:
|
|
||||||
job(deserialized_data, from_doctype, to_doctype)
|
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user