Procházet zdrojové kódy

feat: Add log_error and FrappeClient to restricted python (#12857)

version-14
Faris Ansari před 4 roky
committed by GitHub
rodič
revize
8678c09e91
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 4AEE18F83AFDEB23
1 změnil soubory, kde provedl 5 přidání a 2 odebrání
  1. +5
    -2
      frappe/utils/safe_exec.py

+ 5
- 2
frappe/utils/safe_exec.py Zobrazit soubor

@@ -12,6 +12,7 @@ from frappe.modules import scrub
from frappe.www.printview import get_visible_columns from frappe.www.printview import get_visible_columns
import frappe.exceptions import frappe.exceptions
import frappe.integrations.utils import frappe.integrations.utils
from frappe.frappeclient import FrappeClient


class ServerScriptNotEnabled(frappe.PermissionError): class ServerScriptNotEnabled(frappe.PermissionError):
pass pass
@@ -104,8 +105,10 @@ def get_safe_globals():
make_post_request = frappe.integrations.utils.make_post_request, make_post_request = frappe.integrations.utils.make_post_request,
socketio_port=frappe.conf.socketio_port, socketio_port=frappe.conf.socketio_port,
get_hooks=frappe.get_hooks, 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( style=frappe._dict(
border_color='#d1d8dd' border_color='#d1d8dd'
), ),
@@ -297,4 +300,4 @@ VALID_UTILS = (
"formatdate", "formatdate",
"get_user_info_for_avatar", "get_user_info_for_avatar",
"get_abbr" "get_abbr"
)
)

Načítá se…
Zrušit
Uložit