From 0a4ee1d829dcc709a2ce75e2b28c43568ecf4cde Mon Sep 17 00:00:00 2001 From: Markus Lobedann Date: Mon, 22 Apr 2024 13:23:18 +0200 Subject: [PATCH] =?UTF-8?q?=20fix:=20=F0=9F=90=9B=20don't=20create=20=5F?= =?UTF-8?q?=5Finit=5F=5F.py=20files=20when=20gathering=20pages=20(#26045)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: :bug: don't create __init__.py files when gathering pages These files are only necessary if any other *.py files exists in a pages folder. Apart from that, this functions purpose (by name) is to get pages, and not create any source code files. closes #25167 * refactor: :coffin: remove commented out code --- frappe/website/router.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/frappe/website/router.py b/frappe/website/router.py index 84efd4e6c6..0f999a2345 100644 --- a/frappe/website/router.py +++ b/frappe/website/router.py @@ -110,10 +110,6 @@ def get_pages_from_path(start, app, app_path): start_path = os.path.join(app_path, start) if os.path.exists(start_path): for basepath, folders, files in os.walk(start_path): # noqa: B007 - # add missing __init__.py - if "__init__.py" not in files and frappe.conf.get("developer_mode"): - open(os.path.join(basepath, "__init__.py"), "a").close() - for fname in files: fname = frappe.utils.cstr(fname) if "." not in fname: @@ -128,7 +124,6 @@ def get_pages_from_path(start, app, app_path): os.path.join(basepath, fname), app, start, basepath, app_path, fname ) pages[page_info.route] = page_info - # print frappe.as_json(pages[-1]) return pages