fix: consolidate CMS page seed scripts and fix 3 bugs

- Fix `ContentPage.store_id is None` (Python identity check, always
  False) → use `.is_(None)` for proper SQLAlchemy NULL filtering
- Create pages for ALL platforms instead of only OMS
- Merge create_platform_pages.py into create_default_content_pages.py
  (5 overlapping pages, only platform_homepage was unique)
- Delete redundant create_platform_pages.py
- Update Makefile, install.py, and docs references

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-14 21:18:47 +01:00
parent 62e418c473
commit 3c2b559282
8 changed files with 139 additions and 624 deletions

View File

@@ -395,7 +395,6 @@ docker compose --profile full exec -e PYTHONPATH=/app api python -m alembic upgr
docker compose --profile full exec -e PYTHONPATH=/app api python scripts/seed/init_production.py
docker compose --profile full exec -e PYTHONPATH=/app api python scripts/seed/init_log_settings.py
docker compose --profile full exec -e PYTHONPATH=/app api python scripts/seed/create_default_content_pages.py
docker compose --profile full exec -e PYTHONPATH=/app api python scripts/seed/create_platform_pages.py
docker compose --profile full exec -e PYTHONPATH=/app api python scripts/seed/seed_email_templates.py
```

View File

@@ -12,10 +12,10 @@
| Script | Purpose | In Makefile? | Issues |
|--------|---------|--------------|--------|
| `seed_demo.py` | Create merchants, stores, customers, products | ✅ Yes | ❌ Missing inventory creation |
| `create_default_content_pages.py` | Create platform CMS pages (about, faq, etc.) | ✅ Yes (`create-cms-defaults`) | ✅ Good |
| `create_default_content_pages.py` | Create platform CMS pages (homepage, about, faq, etc.) for ALL platforms | ✅ Yes (`create-cms-defaults`) | ✅ Good (consolidated) |
| `create_inventory.py` | Create inventory for products | ❌ **NO** | ⚠️ Should be in seed_demo |
| `create_landing_page.py` | Create landing pages for stores | ❌ **NO** | ⚠️ Should be in seed_demo |
| `create_platform_pages.py` | Create platform pages | ❌ **NO** | 🔴 **DUPLICATE** of create_default_content_pages |
| ~~`create_platform_pages.py`~~ | ~~Create platform pages~~ | - | **DELETED** (merged into create_default_content_pages) |
| `init_production.py` | Create admin user + platform alerts | ✅ Yes (`init-prod`) | ✅ Good |
| `init_log_settings.py` | Initialize log settings | ❌ NO | ⚠️ Should be in init_production? |

View File

@@ -67,8 +67,8 @@ app/
│ └── content_page_service.py # CMS business logic
└── main.py # Platform routes (lines 284-404)
scripts/
└── create_platform_pages.py # Seeder script
scripts/seed/
└── create_default_content_pages.py # Seeder script (all platforms)
docs/features/
└── platform-homepage.md # This file
@@ -193,14 +193,17 @@ Manage all platform content pages from a single interface:
```bash
# Create all default platform pages
python scripts/seed/create_platform_pages.py
python scripts/seed/create_default_content_pages.py
```
This creates:
This creates (for all platforms):
- Platform Homepage (with modern template)
- About Us
- FAQ
- Contact Us
- FAQ
- Shipping Policy
- Return & Refund Policy
- Privacy Policy
- Terms of Service
- Privacy Policy
@@ -568,7 +571,7 @@ return templates.TemplateResponse(
**Solutions:**
1. Run seeder script:
```bash
python scripts/seed/create_platform_pages.py
python scripts/seed/create_default_content_pages.py
```
2. Verify page exists:

View File

@@ -11,10 +11,10 @@ Quick reference for setting up and customizing the platform homepage and content
Run the seeder script to create all default platform pages:
```bash
python scripts/seed/create_platform_pages.py
python scripts/seed/create_default_content_pages.py
```
This creates:
This creates (for all platforms):
- ✅ Platform Homepage (modern template)
- ✅ About Us
- ✅ FAQ
@@ -253,7 +253,7 @@ Result in header: `About | FAQ | Contact`
**Fix:** Run seeder script
```bash
python scripts/seed/create_platform_pages.py
python scripts/seed/create_default_content_pages.py
```
### Navigation menu is empty