Skip to content

Commit

Permalink
fix: 馃悰 don't create __init__.py files when gathering pages (#26045)
Browse files Browse the repository at this point in the history
* fix: 馃悰 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: 鈿帮笍 remove commented out code
  • Loading branch information
Mutantpenguin committed Apr 22, 2024
1 parent 03de739 commit 0a4ee1d
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions frappe/website/router.py
Expand Up @@ -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:
Expand All @@ -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

Expand Down

0 comments on commit 0a4ee1d

Please sign in to comment.