refactor: enable website utils in safe_exec (#25365)
Frappe Builder uses safe_exec to fetch dynamic data, and there are a few functions in website utilities which would be nice to have on that end, get_html_content_based_on_type especially. I added a few others which seemed useful and safe as well.
This commit is contained in:
parent
b7bc5d3236
commit
12f193231d
1 changed files with 7 additions and 0 deletions
|
|
@ -262,6 +262,13 @@ def get_safe_globals():
|
||||||
before_rollback=frappe.db.before_rollback,
|
before_rollback=frappe.db.before_rollback,
|
||||||
add_index=frappe.db.add_index,
|
add_index=frappe.db.add_index,
|
||||||
),
|
),
|
||||||
|
website=NamespaceDict(
|
||||||
|
abs_url=frappe.website.utils.abs_url,
|
||||||
|
extract_title=frappe.website.utils.extract_title,
|
||||||
|
get_boot_data=frappe.website.utils.get_boot_data,
|
||||||
|
get_home_page=frappe.website.utils.get_home_page,
|
||||||
|
get_html_content_based_on_type=frappe.website.utils.get_html_content_based_on_type,
|
||||||
|
),
|
||||||
lang=getattr(frappe.local, "lang", "en"),
|
lang=getattr(frappe.local, "lang", "en"),
|
||||||
),
|
),
|
||||||
FrappeClient=FrappeClient,
|
FrappeClient=FrappeClient,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue