fix: commit regardless of framework's transaction_writes count (#25322)
- There is code that depends on "commit", everything that happens with `db.after_commit`. - There are operations that will not write anything to DB but just enqueue the function, if it's enqueue_after_commit then it will break.
This commit is contained in:
parent
b56e94d1af
commit
acf398f46e
1 changed files with 1 additions and 5 deletions
|
|
@ -399,11 +399,7 @@ def handle_exception(e):
|
|||
|
||||
def sync_database(rollback: bool) -> bool:
|
||||
# if HTTP method would change server state, commit if necessary
|
||||
if (
|
||||
frappe.db
|
||||
and (frappe.local.flags.commit or frappe.local.request.method in UNSAFE_HTTP_METHODS)
|
||||
and frappe.db.transaction_writes
|
||||
):
|
||||
if frappe.db and (frappe.local.flags.commit or frappe.local.request.method in UNSAFE_HTTP_METHODS):
|
||||
frappe.db.commit()
|
||||
rollback = False
|
||||
elif frappe.db:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue