fix(seo-audit): Move load_dotenv before module-level env reads
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
DATABASE_URL and PAGESPEED_API_KEY are read at module level (import time), so load_dotenv must run before third-party imports that reference these variables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
824b482357
commit
05a09812a5
@ -40,9 +40,11 @@ import time as time_module
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Optional, Dict, List, Any, Tuple
|
||||
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '.env'))
|
||||
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from dotenv import load_dotenv
|
||||
from sqlalchemy import create_engine, text
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
@ -1656,8 +1658,6 @@ def print_summary(summary: Dict[str, Any], dry_run: bool = False) -> None:
|
||||
|
||||
def main():
|
||||
"""Main entry point for CLI usage."""
|
||||
# Load .env from project root (handles DATABASE_URL, API keys etc.)
|
||||
load_dotenv(os.path.join(os.path.dirname(__file__), '..', '.env'))
|
||||
parser = argparse.ArgumentParser(
|
||||
description='SEO Audit for Norda Biznes member websites',
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user