add dev mode guards: skip FMCSA submission, fax, and web filing in non-production environments
This commit is contained in:
parent
d6704e850e
commit
6dd311f375
3 changed files with 33 additions and 1 deletions
|
|
@ -186,8 +186,21 @@ class MCS150UpdateHandler:
|
|||
LOG.error("[%s] E-sign setup failed (proceeding anyway): %s", order_number, exc)
|
||||
|
||||
# Step 5: Submit electronically (3x web → fax fallback)
|
||||
# GUARD: Skip actual submission in dev/test environments
|
||||
is_production = os.environ.get("NODE_ENV") == "production" or os.environ.get("ENV") == "production"
|
||||
filing_result = None
|
||||
if pdf_path:
|
||||
if pdf_path and not is_production:
|
||||
LOG.info("[%s] DEV MODE — skipping actual FMCSA submission", order_number)
|
||||
filing_result = {
|
||||
"success": True,
|
||||
"method": "dev_skip",
|
||||
"attested_pdf": None,
|
||||
"submitted_at": datetime.now().isoformat(),
|
||||
"screenshot_path": None,
|
||||
"fax_log_id": None,
|
||||
"error": None,
|
||||
}
|
||||
elif pdf_path:
|
||||
try:
|
||||
import asyncio
|
||||
from scripts.workers.fax_sender import submit_filing
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue