def _check_python_code(self): for action in self.sudo().filtered('code'): msg = test_python_expr(expr=action.code.strip(), mode="exec") if msg: raise ValidationError(msg)
def _check_python_code(self): for record in self.sudo().filtered('compute'): msg = test_python_expr(expr=record.compute.strip(), mode="exec") if msg: raise ValidationError(msg)