[added] frappe.safe_eval

This commit is contained in:
Rushabh Mehta
2017-04-06 18:24:34 +05:30
parent 5e9d72d57b
commit 9365641777
4 changed files with 10 additions and 10 deletions

View File

@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, comma_or, nowdate, getdate
from frappe.utils import flt, comma_or
from frappe import _
from frappe.model.document import Document
@@ -119,7 +119,7 @@ class StatusUpdater(Document):
self.status = s[0]
break
elif s[1].startswith("eval:"):
if eval(s[1][5:]):
if frappe.safe_eval(s[1][5:]):
self.status = s[0]
break
elif getattr(self, s[1])():