diff --git a/frappe/__version__.py b/frappe/__version__.py index 12cf0f14d4..db01fb213a 100644 --- a/frappe/__version__.py +++ b/frappe/__version__.py @@ -1 +1 @@ -__version__ = "4.5.9" +__version__ = "4.6.0" diff --git a/frappe/core/doctype/print_format/print_format.py b/frappe/core/doctype/print_format/print_format.py index a770062147..4d414c50e5 100644 --- a/frappe/core/doctype/print_format/print_format.py +++ b/frappe/core/doctype/print_format/print_format.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe import frappe.utils +from jinja2 import TemplateSyntaxError from frappe.model.document import Document @@ -16,6 +17,12 @@ class PrintFormat(Document): self.old_doc_type = frappe.db.get_value('Print Format', self.name, 'doc_type') + jenv = frappe.get_jenv() + try: + jenv.from_string(self.html) + except TemplateSyntaxError: + frappe.throw(frappe._("Syntax error in Jinja template")) + def on_update(self): if hasattr(self, 'old_doc_type') and self.old_doc_type: frappe.clear_cache(doctype=self.old_doc_type) diff --git a/frappe/core/doctype/print_format/test_records.json b/frappe/core/doctype/print_format/test_records.json index aab3b96884..b0fac3c7ab 100644 --- a/frappe/core/doctype/print_format/test_records.json +++ b/frappe/core/doctype/print_format/test_records.json @@ -3,6 +3,7 @@ "doctype": "Print Format", "name": "_Test Print Format 1", "module": "core", - "doc_type": "User" + "doc_type": "User", + "html": "" } ] diff --git a/frappe/hooks.py b/frappe/hooks.py index f632099952..5fa757ee3a 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -3,7 +3,7 @@ app_title = "Frappe Framework" app_publisher = "Web Notes Technologies Pvt. Ltd." app_description = "Full Stack Web Application Framework in Python" app_icon = "assets/frappe/images/frappe.svg" -app_version = "4.5.9" +app_version = "4.6.0" app_color = "#3498db" app_email = "support@frappe.io" diff --git a/frappe/model/db_query.py b/frappe/model/db_query.py index a5c2f7b723..79ef0e63d4 100644 --- a/frappe/model/db_query.py +++ b/frappe/model/db_query.py @@ -90,7 +90,10 @@ class DatabaseQuery(object): if isinstance(self.filters, basestring): self.filters = json.loads(self.filters) if isinstance(self.fields, basestring): - self.fields = json.loads(self.fields) + if self.fields == "*": + self.fields = ["*"] + else: + self.fields = json.loads(self.fields) if isinstance(self.filters, dict): fdict = self.filters self.filters = [] diff --git a/frappe/model/naming.py b/frappe/model/naming.py index 4f1f827758..804dcc368a 100644 --- a/frappe/model/naming.py +++ b/frappe/model/naming.py @@ -84,6 +84,8 @@ def make_autoname(key, doctype=''): if not "#" in key: key = key + ".#####" + elif not "." in key: + frappe.throw(_("Invalid naming series (. missing)") + (_(" for {0}").format(doctype) if doctype else "")) n = '' l = key.split('.') diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 79b0352b6e..97e0067a79 100644 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -96,7 +96,7 @@ frappe.views.CommunicationList = Class.extend({ "SMS": "icon-mobile-phone", }[doc.communication_medium] || "icon-envelope"; doc.avatar = frappe.get_gravatar(doc._sender_id); - var comm = $(repl('