From 16ff2de946ab3612bb2e852d6575b91e06811eda Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 20 May 2021 20:22:14 +0530 Subject: [PATCH] fix: Make bundled asset URL absolute always --- frappe/utils/jinja_globals.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frappe/utils/jinja_globals.py b/frappe/utils/jinja_globals.py index 625d2e6cd5..347d52dc57 100644 --- a/frappe/utils/jinja_globals.py +++ b/frappe/utils/jinja_globals.py @@ -81,9 +81,10 @@ def include_style(path): def bundled_asset(path): from frappe.utils import get_assets_json + from frappe.website.utils import abs_url - if path.startswith("/assets") or ".bundle." not in path: - return path + if ".bundle." in path and not path.startswith("/assets"): + bundled_assets = get_assets_json() + path = bundled_assets.get(path) or path - bundled_assets = get_assets_json() - return bundled_assets.get(path) or path + return abs_url(path)