fix: handle case where web_block is invoked

from places other than web page
This commit is contained in:
Faris Ansari 2022-06-22 12:04:57 +05:30
parent 8814041b33
commit d49f9bfb8f

View file

@ -63,6 +63,11 @@ def web_blocks(blocks):
out = get_web_blocks_html(web_blocks)
html = out.html
if not frappe.flags.web_block_scripts:
frappe.flags.web_block_scripts = {}
frappe.flags.web_block_styles = {}
for template, scripts in out.scripts.items():
# deduplication of scripts when web_blocks methods are used in web pages
# see render_dynamic method web_page.py