Skip to content

Commit

Permalink
fix: lstrip for query writes detection (#26180) (#26253)
Browse files Browse the repository at this point in the history
(cherry picked from commit c0e7799)

Co-authored-by: Nahuel Operto <46027152+Don-Leopardo@users.noreply.github.com>
  • Loading branch information
mergify[bot] and Don-Leopardo committed Apr 30, 2024
1 parent 7d25aed commit 97355f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/database/database.py
Expand Up @@ -425,7 +425,7 @@ def check_transaction_status(self, query):
if query and is_query_type(query, ("commit", "rollback")):
self.transaction_writes = 0

if query[:6].lower() in ("update", "insert", "delete"):
if query.lstrip()[:6].lower() in ("update", "insert", "delete"):
self.transaction_writes += 1
if self.transaction_writes > self.MAX_WRITES_PER_TRANSACTION:
if self.auto_commit_on_many_writes:
Expand Down

0 comments on commit 97355f9

Please sign in to comment.