diff --git a/scripts/workers/services/telecom/auto_filing.py b/scripts/workers/services/telecom/auto_filing.py index 2e53fa4..f6145de 100644 --- a/scripts/workers/services/telecom/auto_filing.py +++ b/scripts/workers/services/telecom/auto_filing.py @@ -74,6 +74,10 @@ def _env_truthy(value: str | None) -> bool: def _settings_from_erpnext() -> tuple[bool, str]: """Read ``Compliance Settings`` from ERPNext — returns (enabled, admin_email).""" + # Fast path: if AUTO_FILING_ENABLED env var is explicitly set, skip ERPNext + env_val = os.environ.get("AUTO_FILING_ENABLED") + if env_val is not None: + return _env_truthy(env_val), (os.environ.get("ADMIN_EMAIL") or DEFAULT_ADMIN_EMAIL) try: from scripts.workers.erpnext_client import ERPNextClient