Revert "fix: use JSON.parse() for filter processing"

This commit is contained in:
Ejaaz Khan 2026-03-25 14:41:36 +05:30 committed by GitHub
parent 89fd385a60
commit 6a4e810800
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 19 deletions

View file

@ -76,18 +76,6 @@ class Workspace(Document):
if self.public and not is_workspace_manager() and not disable_saving_as_public():
frappe.throw(_("You need to be Workspace Manager to edit this document"))
if (
not self.public
and self.for_user
and self.for_user != frappe.session.user
and not is_workspace_manager()
):
frappe.throw(
_("You are not allowed to edit this workspace"),
frappe.PermissionError,
)
if self.has_value_changed("title"):
validate_route_conflict(self.doctype, self.title)
else:

View file

@ -1933,13 +1933,7 @@ Object.assign(frappe.utils, {
process_filter_expression(filter) {
let filters = [];
if (filter) {
try {
filters = JSON.parse(filter);
} catch {
console.warn("Invalid JSON in filter expression", filter);
}
}
filters = filter ? new Function(`return ${filter}`)() : [];
return this.cleanup_filters(filters);
},
cleanup_filters(filters) {