From eac640ed772d426edc73c065d60eaeb10dedd847 Mon Sep 17 00:00:00 2001 From: mardausdennis <71312763+mardausdennis@users.noreply.github.com> Date: Mon, 17 Aug 2026 00:33:08 +0200 Subject: [PATCH] fix(i18n): let generate-pot-file import hooks without a site hooks.py reads frappe.conf at import time. bench generate-pot-file --app builder imports hooks without a site bound, so the proxy raises RuntimeError: object is not bound and extraction never starts. Every recorded run of generate-pot-file.yml has failed this way since the workflow was added on 2026-08-08. The same workflow runs green in frappe/crm and frappe/lms, so a site-less import is the expected contract. Behaviour is unchanged wherever a site is bound; only the site-less import falls back to the default path. --- builder/hooks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builder/hooks.py b/builder/hooks.py index 22f86c42f..16eb9890b 100644 --- a/builder/hooks.py +++ b/builder/hooks.py @@ -195,7 +195,12 @@ # "builder.auth.validate" # ] -builder_path = frappe.conf.builder_path or "builder" +try: + builder_path = frappe.conf.builder_path or "builder" +except RuntimeError: + # frappe.conf is unbound when hooks are imported without a site, + # as done by `bench generate-pot-file --app builder`. + builder_path = "builder" website_route_rules = [ {"from_route": f"/{builder_path}/", "to_route": "_builder"}, {"from_route": f"/{builder_path}", "to_route": "_builder"},