Skip to content

Commit

Permalink
fix: lstrip for query writes detection (#26180)
Browse files Browse the repository at this point in the history
(cherry picked from commit c0e7799)
  • Loading branch information
Don-Leopardo authored and mergify[bot] committed Apr 30, 2024
1 parent 5c4cdc0 commit dafa6ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/database/database.py
Expand Up @@ -439,7 +439,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 dafa6ee

Please sign in to comment.