fix: Validate Python syntax on saves
This commit is contained in:
parent
8ff2b57b35
commit
b3d52fcd57
1 changed files with 4 additions and 2 deletions
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import ast
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils.safe_exec import safe_exec
|
||||
|
|
@ -11,9 +13,9 @@ from frappe import _
|
|||
|
||||
|
||||
class ServerScript(Document):
|
||||
@staticmethod
|
||||
def validate():
|
||||
def validate(self):
|
||||
frappe.only_for('Script Manager', True)
|
||||
ast.parse(self.script)
|
||||
|
||||
@staticmethod
|
||||
def on_update():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue