From 213a60533cac51eb10b9628360068fe20ed64779 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Fri, 29 May 2026 00:02:44 +0200 Subject: [PATCH] fix(seed): correct sys.path so seed_email_templates_core can import app.* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- scripts/seed/seed_email_templates_core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/seed/seed_email_templates_core.py b/scripts/seed/seed_email_templates_core.py index ab3013a2..7e6c9fc5 100644 --- a/scripts/seed/seed_email_templates_core.py +++ b/scripts/seed/seed_email_templates_core.py @@ -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 [