fix: lock the doc before deleting
Locking only prevents this kinda race conditions: - User A deletes doc - User B modifies doc so that it's not deletable anymore.
This commit is contained in:
parent
b044ffedf1
commit
8f00aae160
1 changed files with 1 additions and 1 deletions
|
|
@ -104,7 +104,7 @@ def delete_doc(
|
|||
pass
|
||||
|
||||
else:
|
||||
doc = frappe.get_doc(doctype, name)
|
||||
doc = frappe.get_doc(doctype, name, for_update=True)
|
||||
|
||||
if not for_reload:
|
||||
update_flags(doc, flags, ignore_permissions)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue