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"},