style: apply black and isort formatting across entire codebase

- Standardize quote style (single to double quotes)
- Reorder and group imports alphabetically
- Fix line breaks and indentation for consistency
- Apply PEP 8 formatting standards

Also updated Makefile to exclude both venv and .venv from code quality checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-28 19:30:17 +01:00
parent 13f0094743
commit 21c13ca39b
236 changed files with 8450 additions and 6545 deletions

View File

@@ -12,18 +12,20 @@ from pathlib import Path
# Add project root to path
sys.path.insert(0, str(Path(__file__).parent.parent))
from sqlalchemy.orm import Session
from app.core.database import SessionLocal
from models.database.vendor import Vendor
from models.database.content_page import ContentPage
from datetime import datetime, timezone
from sqlalchemy.orm import Session
from app.core.database import SessionLocal
from models.database.content_page import ContentPage
from models.database.vendor import Vendor
def create_landing_page(
vendor_subdomain: str,
template: str = "default",
title: str = None,
content: str = None
content: str = None,
):
"""
Create a landing page for a vendor.
@@ -38,9 +40,7 @@ def create_landing_page(
try:
# Find vendor
vendor = db.query(Vendor).filter(
Vendor.subdomain == vendor_subdomain
).first()
vendor = db.query(Vendor).filter(Vendor.subdomain == vendor_subdomain).first()
if not vendor:
print(f"❌ Vendor '{vendor_subdomain}' not found!")
@@ -49,10 +49,11 @@ def create_landing_page(
print(f"✅ Found vendor: {vendor.name} (ID: {vendor.id})")
# Check if landing page already exists
existing = db.query(ContentPage).filter(
ContentPage.vendor_id == vendor.id,
ContentPage.slug == "landing"
).first()
existing = (
db.query(ContentPage)
.filter(ContentPage.vendor_id == vendor.id, ContentPage.slug == "landing")
.first()
)
if existing:
print(f"⚠️ Landing page already exists (ID: {existing.id})")
@@ -74,7 +75,8 @@ def create_landing_page(
vendor_id=vendor.id,
slug="landing",
title=title or f"Welcome to {vendor.name}",
content=content or f"""
content=content
or f"""
<h2>About {vendor.name}</h2>
<p>{vendor.description or 'Your trusted shopping destination for quality products.'}</p>
@@ -96,7 +98,7 @@ def create_landing_page(
published_at=datetime.now(timezone.utc),
show_in_footer=False,
show_in_header=False,
display_order=0
display_order=0,
)
db.add(landing_page)
@@ -141,10 +143,13 @@ def list_vendors():
print(f" Code: {vendor.vendor_code}")
# Check if has landing page
landing = db.query(ContentPage).filter(
ContentPage.vendor_id == vendor.id,
ContentPage.slug == "landing"
).first()
landing = (
db.query(ContentPage)
.filter(
ContentPage.vendor_id == vendor.id, ContentPage.slug == "landing"
)
.first()
)
if landing:
print(f" Landing Page: ✅ ({landing.template})")
@@ -165,7 +170,7 @@ def show_templates():
("default", "Clean professional layout with 3-column quick links"),
("minimal", "Ultra-simple centered design with single CTA"),
("modern", "Full-screen hero with animations and features"),
("full", "Maximum features with split-screen hero and stats")
("full", "Maximum features with split-screen hero and stats"),
]
for name, desc in templates:
@@ -209,7 +214,7 @@ if __name__ == "__main__":
success = create_landing_page(
vendor_subdomain=vendor_subdomain,
template=template,
title=title if title else None
title=title if title else None,
)
if success: