Browse Source

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

version-14
Faris Ansari 4 years ago
committed by GitHub
parent
commit
8678c09e91
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      frappe/utils/safe_exec.py

+ 5
- 2
frappe/utils/safe_exec.py View File

@@ -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"
)
)

Loading…
Cancel
Save