fix(DX): Allow db.commit from drop-down console (#38688)

This is anyways allowed, it's just extra friction at this point.

After using it for a while I feel we should allow it from drop-down
console too now.

It's risky, but hey, you're literally executing arbitrary code you just
wrote so I am trusting you.
This commit is contained in:
Ankush Menat 2026-04-17 17:59:48 +05:30 committed by GitHub
parent c6d1a2362d
commit a96482b7b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,9 +29,7 @@ class SystemConsole(Document):
try:
frappe.local.debug_log = []
if self.type == "Python":
safe_exec(
self.console, script_filename="System Console", restrict_commit_rollback=not self.commit
)
safe_exec(self.console, script_filename="System Console")
self.output = "\n".join(frappe.debug_log)
elif self.type == "SQL":
frappe.db.begin(read_only=True)