diff --git a/frappe/tests/test_safe_exec.py b/frappe/tests/test_safe_exec.py index d1d6de45aa..783d05ff37 100644 --- a/frappe/tests/test_safe_exec.py +++ b/frappe/tests/test_safe_exec.py @@ -27,8 +27,7 @@ class TestSafeExec(unittest.TestCase): def test_query_builder(self): _locals = dict(out=None) - safe_exec(script='''out = frappe.qb.from_("User").select(frappe.qb.terms.PseudoColumn("Max(name)")).run()''', - _globals=None, _locals=_locals) + safe_exec(script='''out = frappe.qb.from_("User").select(frappe.qb.terms.PseudoColumn("Max(name)")).run()''', _globals=None, _locals=_locals) self.assertEqual(frappe.db.sql("SELECT Max(name) FROM tabUser"), _locals["out"]) def test_safe_query_builder(self): diff --git a/frappe/utils/safe_exec.py b/frappe/utils/safe_exec.py index d1e8be3f83..9f52d17ef4 100644 --- a/frappe/utils/safe_exec.py +++ b/frappe/utils/safe_exec.py @@ -32,10 +32,8 @@ class NamespaceDict(frappe._dict): def get_safe_query_builder(): """Allows execution of SELECT SQL queries only. - Raises: - PermissionsError raised on execution of any other SQL query. - + PermissionsError raised on execution of any other SQL query """ query_class = get_attr(str(frappe.qb).split("'")[1]) class SafeQB(query_class):