From 8678c09e910b193fa9b1239fae75373bed62a1c8 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 15 Apr 2021 14:34:23 +0530 Subject: [PATCH] feat: Add log_error and FrappeClient to restricted python (#12857) --- frappe/utils/safe_exec.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frappe/utils/safe_exec.py b/frappe/utils/safe_exec.py index 29bded6fc8..6c1fa21685 100644 --- a/frappe/utils/safe_exec.py +++ b/frappe/utils/safe_exec.py @@ -12,6 +12,7 @@ from frappe.modules import scrub from frappe.www.printview import get_visible_columns import frappe.exceptions import frappe.integrations.utils +from frappe.frappeclient import FrappeClient class ServerScriptNotEnabled(frappe.PermissionError): pass @@ -104,8 +105,10 @@ def get_safe_globals(): make_post_request = frappe.integrations.utils.make_post_request, socketio_port=frappe.conf.socketio_port, get_hooks=frappe.get_hooks, - sanitize_html=frappe.utils.sanitize_html + sanitize_html=frappe.utils.sanitize_html, + log_error=frappe.log_error ), + FrappeClient=FrappeClient, style=frappe._dict( border_color='#d1d8dd' ), @@ -297,4 +300,4 @@ VALID_UTILS = ( "formatdate", "get_user_info_for_avatar", "get_abbr" -) \ No newline at end of file +)