fix(seed): correct sys.path so seed_email_templates_core can import app.*
Some checks failed
Some checks failed
Script lived at scripts/seed/seed_email_templates_core.py and inserted Path(__file__).parent.parent into sys.path — that resolves to scripts/, not the project root, so `from app.core.database import get_db` raises ModuleNotFoundError when run from inside the container. The loyalty sibling already uses parent.parent.parent correctly. Hit during the FR/DE password_reset reseed on prod. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,8 +10,8 @@ import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Add project root to path
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
# Add project root to path (script is at scripts/seed/, project root is two levels up)
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
|
||||
|
||||
# Register all models with SQLAlchemy so string-based relationships resolve
|
||||
for _mod in [
|
||||
|
||||
Reference in New Issue
Block a user