diff --git a/frappe/www/app.html b/frappe/www/app.html
index f4de074d32..9189570674 100644
--- a/frappe/www/app.html
+++ b/frappe/www/app.html
@@ -42,7 +42,7 @@
if (!window.frappe) window.frappe = {};
- frappe.boot = {{ boot }};
+ frappe.boot = JSON.parse({{ boot }});
frappe._messages = frappe.boot["__messages"];
frappe.csrf_token = "{{ csrf_token }}";
diff --git a/frappe/www/app.py b/frappe/www/app.py
index 9a8c80d6b1..0447d00f89 100644
--- a/frappe/www/app.py
+++ b/frappe/www/app.py
@@ -2,6 +2,7 @@
# License: MIT. See LICENSE
no_cache = 1
+import json
import os
import re
@@ -32,13 +33,14 @@ def get_context(context):
frappe.db.commit()
- boot_json = frappe.as_json(boot)
+ boot_json = frappe.as_json(boot, indent=None, separators=(",", ":"))
# remove script tags from boot
boot_json = SCRIPT_TAG_PATTERN.sub("", boot_json)
# TODO: Find better fix
boot_json = CLOSING_SCRIPT_TAG_PATTERN.sub("", boot_json)
+ boot_json = json.dumps(boot_json)
context.update(
{