Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: insert many api updates #26407

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion frappe/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,15 @@ def insert_many(docs=None):
if len(docs) > 200:
frappe.throw(_("Only 200 inserts allowed in one request"))

return [insert_doc(doc).name for doc in docs]
response = []

for idx, doc in enumerate(docs, start=1):
try:
response.append(insert_doc(doc).name)
except Exception as e:
response.append({"error": e, "doc": doc, "idx": idx})

return response


@frappe.whitelist(methods=["POST", "PUT"])
Expand Down